Opened 13 years ago

Closed 13 years ago

Last modified 12 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 Holovaty
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: no UI/UX: no


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 .

Change History (2)

comment:1 Changed 13 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 13 years ago by anonymous

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top