Opened 18 years ago
Closed 18 years ago
#3293 closed defect (fixed)
[patch] newforms: IntegerField should return None on empty
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | normal | Keywords: | newforms integerfield |
Cc: | Honza.Kral@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
if integer field is not required and left empty, clean_data contains u''
(an empty string), which will fail when you try to insert it into DB via model as:
m = Model( ** clean-data ) m.save()
attached patch modifies the behavior of IntegerField
to return None, just like DateField
etc.
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | interger_field.patch added |
---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Haven't checked, but this could be the same for booleanfields too.