SelectDateWidget should be updated to use new is_required Widget attribute
|Reported by:||Mitar||Owned by:||nobody|
|Cc:||mmitar@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Overridden widgets in ModelForm do not respect blank (not required) flag of the model field because they are initialized in advance and already made object is passed for the widget.
The problem is for example with SelectDateWidget which is by default configured as required. So I have to manually set
required constructor argument to
False for model fields which are not required. This obviously contradicts DRY concept.
I propose that if
required argument is not passed to the constructor explicitly then default should be taken from the model field and not that it is
True by default.
Change History (12)
comment:5 Changed 6 years ago by
|Summary:||Overridden widgets in ModelForm do not respect blank flag of model field → SelectDateWidget should be updated to use new is_required Widget attribute|
|Triage Stage:||Design decision needed → Accepted|
|Version:||1.2 → SVN|