forms
main.forms
¤
Forms needed by ProCAT.
Classes¤
CostRecoveryForm
¤
Bases: Form
Form to use in the Cost Recovery view.
CustomUserCreationForm
¤
FundingInlineForm
¤
ProjectForm
¤
ProjectPhaseForm(*args, **kwargs)
¤
Bases: ModelForm
Form to create and edit Project Phase instances.
Override init to populate 'days', if available.
Source code in main/forms.py
88 89 90 91 92 | |
Classes¤
Meta
¤
Meta class for the form.
Methods:¤
clean()
¤
Convert the 'days' field into the model's 'value' (FTE) field.
Source code in main/forms.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
ProjectPhaseInlineForm(*args, **kwargs)
¤
Bases: ProjectPhaseForm
Form to create and edit a Project Phase row inline, as part of a Project form.
Identical to ProjectPhaseForm, except that:
- the
projectfield is left out, since it is supplied automatically by the enclosing formset (seeProjectPhaseInlineFormSet); - the database-backed sibling checks (phase overlap, alignment, and
single maintenance phase - see
models.ProjectPhase.clean()) are skipped during the normal per-row validation. Instead,ProjectPhaseInlineFormSetBase.clean()performs them once, together, against the complete, in-memory set of phases being submitted, once all rows have passed their individual field-level validation.
Override init to flag the instance as validated by the formset.
Source code in main/forms.py
162 163 164 165 | |
ProjectPhaseInlineFormSetBase
¤
Bases: BaseInlineFormSet
Inline formset to create/edit all Project Phases of a Project together.
Validates the phases as a group (overlap, alignment, single maintenance phase) against their complete, in-memory candidate set - i.e. every surviving (not deleted, not blank) row, whether new or pre-existing - rather than one row at a time against the database. This allows several new and/or edited phases to be submitted together in a single request.
Methods:¤
clean()
¤
Validate the whole set of (surviving) phases together.
Source code in main/forms.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |