forms
main.forms
¤
Forms needed by ProCAT.
Classes¤
AllocationInlineForm(*args, **kwargs)
¤
Bases: ModelForm
Form to create and edit an allocation row inline, as part of a Project form.
The project field is left out, since it is supplied automatically by
the enclosing formset (see AllocationInlineFormSet).
Override init to filter user field to RSETeam members only.
Source code in main/forms.py
247 248 249 250 251 252 253 254 255 | |
CostRecoveryForm
¤
Bases: Form
Form to use in the Cost Recovery view.
CustomUserCreationForm
¤
FundingInlineForm
¤
ProjectForm(*args, **kwargs)
¤
Bases: ModelForm
Form to create and edit Project instances.
Override init to filter lead field to RSETeam members only.
Source code in main/forms.py
68 69 70 71 72 73 74 75 76 | |
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
98 99 100 101 102 | |
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
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
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
172 173 174 175 | |
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
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |