Code

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5509 closed (invalid)

Allows {{{''}}} as a valid value (in Blank=True fields)

Reported by: DXpublica@… Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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,

Attachments (0)

Change History (3)

comment:1 follow-up: Changed 7 years ago by cgrady

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 7 years ago by cgrady

That should say "allows '' as a valid value", instead of turning it italics

comment:3 in reply to: ↑ 2 Changed 7 years ago by anonymous

  • Summary changed from There is no way for reverting Blank value to 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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.