Changes between Initial Version and Version 2 of Ticket #12858


Ignore:
Timestamp:
Feb 17, 2010, 6:27:53 PM (15 years ago)
Author:
Russell Keith-Magee
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12858

    • Property Needs tests set
    • Property Triage Stage UnreviewedAccepted
  • Ticket #12858 – Description

    initial v2  
    1 I have a {{{ModelFormset with some extra forms. The model the forms are based on contains a {{{DateField}}} with {{{default=datetime.date.today}}}, and other fields which are required. It must be possible to submit the formset without filling in all extra forms (which wouldn't validate when empty, due to the fact that there are required fields), so the formset sets {{{empty_permitted}}} on the extra forms: this lets those forms skip validation as long as their fields have not changed ({{{if self.empty_permitted and not self.has_changed())}}} in {{{BaseForm.full_clean}}}. So far this is all standard formset behaviour.
     1I have a {{{ModelFormset}}} with some extra forms. The model the forms are based on contains a {{{DateField}}} with {{{default=datetime.date.today}}}, and other fields which are required. It must be possible to submit the formset without filling in all extra forms (which wouldn't validate when empty, due to the fact that there are required fields), so the formset sets {{{empty_permitted}}} on the extra forms: this lets those forms skip validation as long as their fields have not changed ({{{if self.empty_permitted and not self.has_changed())}}} in {{{BaseForm.full_clean}}}. So far this is all standard formset behaviour.
    22
    33I need to render the dates in a custom (ie local) format, so I have an {{{__init__}}} method on my modelform which replaces the widgets of {{{DateField}}}s with a {{{DateInput}}} created with the desired format. This is also rather standard widget customization.
Back to Top