Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#908 closed defect (invalid)

writing Null instead of the default value to the database in default object manipulator

Reported by: anonymous Owned by: adrian
Component: Metasystem Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have a field definition:

main_photo = meta.IntegerField('main_photo', default=0, blank=True)

and when I'm using generic views, with a template without that field, django tries to write NULL to the database, whereas in my opinion it should put 0 .

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by rjwittams

You can't leave out any fields from a generic view in trunk.
It will treat this as if the field is blank, and it will fill it with NULL.

This is fixed in new-admin : you can provide a 'follow' argument
to suppress fields,

eg (r'/whatever/$', 'create', {

'app_label' : my_blog,
'module_name': entries,
'follow' : {'main_photo': False },

} )

See NewAdminChanges.

comment:2 Changed 8 years ago by anonymous

  • Resolution set to invalid
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.