#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 , 20 years ago
comment:2 by , 20 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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', {
See NewAdminChanges.