Opened 10 years ago

Closed 10 years ago

Last modified 9 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:


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 10 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 10 years ago by anonymous

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top