Opened 13 years ago

Closed 13 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 Holovaty
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: no UI/UX: no


I have read 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.

Change History (1)

comment:1 Changed 13 years ago by Adrian Holovaty

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top