Forms
hypha.apply.funds.forms
¶
ApplicationSubmissionModelForm
¶
Bases: ModelForm
Application Submission model's save method performs several operations which are not required in forms which update fields (ie. status). It also has a side effect of creating a new file uploads every time with long filenames (#1572).
save
¶
Save this form's self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance. https://github.com/django/django/blob/5d9cf79baf07fc4aed7ad1b06990532a65378155/django/forms/models.py#L444
Source code in hypha/apply/funds/forms.py
ProgressSubmissionForm
¶
Bases: ApplicationSubmissionModelForm
Source code in hypha/apply/funds/forms.py
Meta
¶
save
¶
Save this form's self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance. https://github.com/django/django/blob/5d9cf79baf07fc4aed7ad1b06990532a65378155/django/forms/models.py#L444
Source code in hypha/apply/funds/forms.py
UpdateSubmissionLeadForm
¶
Bases: ApplicationSubmissionModelForm
Source code in hypha/apply/funds/forms.py
Meta
¶
save
¶
Save this form's self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance. https://github.com/django/django/blob/5d9cf79baf07fc4aed7ad1b06990532a65378155/django/forms/models.py#L444
Source code in hypha/apply/funds/forms.py
UpdateReviewersForm
¶
Bases: ApplicationSubmissionModelForm
Source code in hypha/apply/funds/forms.py
reviewer_reviewers
class-attribute
instance-attribute
¶
reviewer_reviewers = forms.ModelMultipleChoiceField(queryset=User.objects.reviewers().only('pk', 'full_name'), label=_('External Reviewers'), required=False)
submitted_reviewers
instance-attribute
¶
submitted_reviewers = User.objects.filter(id__in=self.instance.assigned.reviewed().values('reviewer'))
Meta
¶
prepare_field
¶
clean
¶
Source code in hypha/apply/funds/forms.py
save
¶
- Update role reviewers
- Update non-role reviewers 2a. Remove those not on form 2b. Add in any new non-role reviewers selected
Source code in hypha/apply/funds/forms.py
BatchUpdateReviewersForm
¶
Bases: Form
Source code in hypha/apply/funds/forms.py
submissions
class-attribute
instance-attribute
¶
external_reviewers
class-attribute
instance-attribute
¶
external_reviewers = forms.ModelMultipleChoiceField(queryset=User.objects.reviewers().only('pk', 'full_name'), widget=MultiCheckboxesWidget(attrs={'data-placeholder': _('Select...')}), label=_('External Reviewers'), required=False)
clean_submissions
¶
clean
¶
Source code in hypha/apply/funds/forms.py
submissions_cant_have_external_reviewers
¶
UpdateAuthorForm
¶
Bases: ApplicationSubmissionModelForm
Source code in hypha/apply/funds/forms.py
GroupedModelChoiceIterator
¶
GroupedModelMultipleChoiceField
¶
Bases: ModelMultipleChoiceField
Source code in hypha/apply/funds/forms.py
iterator
instance-attribute
¶
iterator = partial(GroupedModelChoiceIterator, groupby=choices_groupby)
UpdateMetaTermsForm
¶
Bases: ApplicationSubmissionModelForm
Source code in hypha/apply/funds/forms.py
meta_terms
class-attribute
instance-attribute
¶
meta_terms = GroupedModelMultipleChoiceField(queryset=None, widget=MultiCheckboxesWidget(attrs={'data-placeholder': _('Select...')}), label=_('Tags'), choices_groupby='get_parent', required=False, help_text=_('Tags are hierarchical in nature.'))
Meta
¶
save
¶
Save this form's self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance. https://github.com/django/django/blob/5d9cf79baf07fc4aed7ad1b06990532a65378155/django/forms/models.py#L444
Source code in hypha/apply/funds/forms.py
CreateReminderForm
¶
Bases: ModelForm
Source code in hypha/apply/funds/forms.py
submission
class-attribute
instance-attribute
¶
submission = forms.ModelChoiceField(queryset=ApplicationSubmission.objects.filter(), widget=forms.HiddenInput())
Meta
¶
save
¶
Source code in hypha/apply/funds/forms.py
InviteCoApplicantForm
¶
Bases: ModelForm
Source code in hypha/apply/funds/forms.py
invited_user_email
class-attribute
instance-attribute
¶
role
class-attribute
instance-attribute
¶
role = forms.ChoiceField(choices=CoApplicantRole.choices, label=_('Role'), required=False)
project_permission
class-attribute
instance-attribute
¶
project_permission = forms.MultipleChoiceField(choices=CoApplicantProjectPermission.choices, required=False, widget=forms.CheckboxSelectMultiple, label=_('Project permissions'), help_text=_('Enable same access level to these sections. Example: View role + Contracting = read-only contracting access.'))
submission
class-attribute
instance-attribute
¶
submission = forms.ModelChoiceField(queryset=ApplicationSubmission.objects.filter(), widget=forms.HiddenInput())
Meta
¶
EditCoApplicantForm
¶
Bases: ModelForm
Source code in hypha/apply/funds/forms.py
role
class-attribute
instance-attribute
¶
role = forms.ChoiceField(choices=CoApplicantRole.choices, label=_('Role'), required=False)
project_permission
class-attribute
instance-attribute
¶
project_permission = forms.MultipleChoiceField(choices=CoApplicantProjectPermission.choices, required=False, widget=forms.CheckboxSelectMultiple, label=_('Project permissions'), help_text=_('Enable same access level to these sections. Example: View role + Contracting = read-only contracting access.'))