Code

Opened 8 years ago

Closed 8 years ago

#2516 closed enhancement (wontfix)

Add 'optional' argument to model fields as shortcut for "blank=True, null=True"

Reported by: tvon@… Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have read http://www.b-list.org/weblog/2006/06/28/django-tips-difference-between-blank-and-null and can understand the logic behind having both the blank and null arguments, but the reasoning for this ("there are times when you need it") seems to be the exception and not the rule. Wouldn't it make sense to provide a keyword agrument 'optional' that, when true, shortcuts the otherwise confusing "blank=True, null=True" arguments?

I think this would make things eaiser to understand for newcomers who want optional fields while still providing the same flexability with.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

No, we won't be adding this. First, it would create more than one way of expressing the same thing. Second, you don't always *need* null=True. For example, a CharField should not have null=True, but an IntegerField should.

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.