Changes between Initial Version and Version 2 of Ticket #12858


Ignore:
Timestamp:
02/17/2010 06:27:53 PM (5 years ago)
Author:
russellm
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12858

    • Property Patch needs improvement unset
    • Property Needs documentation unset
    • Property Needs tests set
    • Property Triage Stage changed from Unreviewed to Accepted
  • 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