Opened 19 years ago

Closed 19 years ago

Last modified 18 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

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 .

Change History (2)

comment:1 by rjwittams, 19 years ago

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

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