#5509 closed (invalid)
Allows {{{''}}} as a valid value (in Blank=True fields)
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | 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
If blank=True in one field, there is no possibility (nop in admin nop in shell) to revert one field to blank after set this field.
It's perhaps an incongruent thing for user: if one field allowed to be blank initially, then it should be able to be blank always, so unset the value in the field and set it to blank
In shell, we could have:
a.onefield=Blank
as a.onefield=None exists
Thanks a lot,
Xan.
Following: http://groups.google.com/group/django-users/browse_thread/thread/20903fd9f4c59495/a9e0e4e5d16d2324,
Change History (3)
follow-up: 2 comment:1 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
follow-up: 3 comment:2 by , 17 years ago
That should say "allows ''
as a valid value", instead of turning it italics
comment:3 by , 17 years ago
Summary: | There is no way for reverting Blank value → Allows {{{''}}} as a valid value (in Blank=True fields) |
---|
Replying to cgrady:
That should say "allows
''
as a valid value", instead of turning it italics
Yes, this is exactly what I mean.
Sorry for my bad (english) explanation.
I know that it mean user could not set value in the field, but when he set it, he could be revert it to
Blank is unrelated to the database issue, as that thread indicates.
Blank merely means you can leave a field out of form validation - what that means specific to a field depends on that - in a CharField, blank=True allows as a valid value - in a ForeignKey, it would allow you to get through with no value specified, which would then translate to NULL in the database.
As such, there is no need for some 'blank' value to set to things (nor would the value of the blank attribute determine if you can set the model to that or not manually) - just use the proper unset value for whatever you're setting.