Applications
hypha.apply.funds.models.applications
¶
ApplicationBaseManager
¶
Bases: PageQuerySet
order_by_end_date
¶
Source code in hypha/apply/funds/models/applications.py
ApplicationBase
¶
Bases: EmailForm
, WorkflowStreamForm
submission_form_class
class-attribute
instance-attribute
¶
submission_form_class = PageStreamBaseForm
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
WORKFLOW_CHOICES
class-attribute
instance-attribute
¶
WORKFLOW_CHOICES = {name: _vM1for (name, workflow) in items()}
workflow_name
class-attribute
instance-attribute
¶
workflow_name = CharField(choices=items(), max_length=100, default='single', verbose_name=gettext_lazy('Workflow'))
confirmation_text_extra
class-attribute
instance-attribute
¶
confirmation_text_extra = TextField(blank=True, help_text=gettext_lazy('Additional text for the application confirmation message.'))
email_confirmation_panels
class-attribute
instance-attribute
¶
email_confirmation_panels = [MultiFieldPanel([FieldRowPanel([FieldPanel('from_address', classname='col6'), FieldPanel('to_address', classname='col6')]), FieldPanel('subject'), FieldPanel('confirmation_text_extra')], heading=gettext_lazy('Confirmation email'))]
email_tab
class-attribute
instance-attribute
¶
email_tab = ObjectList(email_confirmation_panels, heading=gettext_lazy('Confirmation email'))
reviewers
class-attribute
instance-attribute
¶
reviewers = ParentalManyToManyField(AUTH_USER_MODEL, related_name='%(class)s_reviewers', limit_choices_to=LIMIT_TO_REVIEWERS, blank=True)
image
class-attribute
instance-attribute
¶
image = ForeignKey('images.CustomImage', null=True, blank=True, on_delete=SET_NULL, related_name='+')
weight
class-attribute
instance-attribute
¶
weight = PositiveIntegerField(default=1, blank=True, validators=[MinValueValidator(1), MaxValueValidator(100)])
guide_link
class-attribute
instance-attribute
¶
guide_link = URLField(blank=True, max_length=255, help_text=gettext_lazy('Link to the apply guide.'))
slack_channel
class-attribute
instance-attribute
¶
slack_channel = CharField(blank=True, max_length=128, help_text=gettext_lazy('The slack #channel for notifications. If left empty, notifications will go to the default channel.'))
activity_digest_recipient_emails
class-attribute
instance-attribute
¶
activity_digest_recipient_emails = ArrayField(EmailField(default=''), blank=True, null=True, help_text=gettext_lazy('Comma separated list of emails where a summary of all the activities related to this fund will be sent.'))
list_on_front_page
class-attribute
instance-attribute
¶
list_on_front_page = BooleanField(default=True, help_text=gettext_lazy('Should the fund be listed on the front page.'))
show_deadline
class-attribute
instance-attribute
¶
show_deadline = BooleanField(default=True, help_text=gettext_lazy('Should the deadline date be visible for users.'))
parent_page_types
class-attribute
instance-attribute
¶
content_panels
class-attribute
instance-attribute
¶
content_panels = content_panels + [FieldPanel('reviewers', widget=CheckboxSelectMultiple), FieldPanel('guide_link'), FieldPanel('description'), FieldPanel('image'), FieldPanel('weight'), FieldPanel('slack_channel'), FieldPanel('activity_digest_recipient_emails'), FieldPanel('list_on_front_page'), FieldPanel('show_deadline')]
edit_handler
class-attribute
instance-attribute
¶
edit_handler = TabbedInterface([ObjectList(content_panels, heading=gettext_lazy('Content')), email_tab, ObjectList(promote_panels, heading=gettext_lazy('Promote'))])
from_db
classmethod
¶
Deserialize form data when loading from database.
Parameters:
-
db
–Database connection
-
field_names
–List of field names being loaded
-
values
–Values for the fields
Returns:
-
–
Instance with deserialized form data
Source code in hypha/apply/stream_forms/models.py
deserialize_form_data
classmethod
¶
Convert stored form data back into Python objects.
Parameters:
-
instance
–Form instance
-
form_data
–Raw form data from database
-
form_fields
–Form field definitions
Returns:
-
–
Deserialized form data
Source code in hypha/apply/stream_forms/models.py
get_defined_fields
¶
get_form_fields
¶
Generate form fields with applied logic and grouping.
Parameters:
-
draft
–Whether this is a draft form. When True, fields that are not marked as ApplicationMustIncludeFieldBlock will have their required flag set to False, allowing incomplete form submissions to be saved as drafts.
-
form_data
–Existing form data
-
user
–User completing the form
Returns:
-
–
OrderedDict of form fields
Source code in hypha/apply/stream_forms/models.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
get_form_class
¶
Dynamically creates and returns a form class based on the field configuration.
Creates a new form class that inherits from submission_form_class (PageStreamBaseForm) and includes all the dynamically generated form fields.
Parameters:
-
draft
–Whether this is a draft form
-
form_data
–Existing form data for pre-populating form fields
-
user
–User completing the form, used for auto-populating user fields.
Returns:
-
–
A dynamically generated form class
Source code in hypha/apply/stream_forms/models.py
render_landing_page
¶
Source code in hypha/apply/funds/models/utils.py
send_mail
¶
get_template
¶
open_round
¶
next_deadline
¶
serve
¶
Source code in hypha/apply/funds/models/applications.py
RoundBase
¶
Bases: WorkflowStreamForm
, SubmittableStreamForm
submission_form_class
class-attribute
instance-attribute
¶
submission_form_class = PageStreamBaseForm
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
WORKFLOW_CHOICES
class-attribute
instance-attribute
¶
WORKFLOW_CHOICES = {name: _7PJfor (name, workflow) in items()}
workflow_name
class-attribute
instance-attribute
¶
workflow_name = CharField(choices=items(), max_length=100, default='single', verbose_name=gettext_lazy('Workflow'))
submission_id_prefix
class-attribute
instance-attribute
¶
submission_id_prefix = SlugField(gettext_lazy('Submission ID Prefix'), max_length=10, blank=True, default='', null=False, help_text=gettext_lazy('Prefix for the submission id. e.g. "HYPHA23-" will result in a submission id of "HYPHA23-1".'))
lead
class-attribute
instance-attribute
¶
lead = ForeignKey(AUTH_USER_MODEL, limit_choices_to=LIMIT_TO_STAFF, related_name='%(class)s_lead', on_delete=PROTECT)
reviewers
class-attribute
instance-attribute
¶
reviewers = ParentalManyToManyField(AUTH_USER_MODEL, related_name='%(class)s_reviewer', limit_choices_to=LIMIT_TO_REVIEWERS, blank=True)
start_date
class-attribute
instance-attribute
¶
end_date
class-attribute
instance-attribute
¶
end_date = DateField(blank=True, null=True, default=today, help_text=gettext_lazy('When no end date is provided the round will remain open indefinitely.'))
content_panels
class-attribute
instance-attribute
¶
content_panels = content_panels + [FieldPanel('lead'), MultiFieldPanel([FieldRowPanel([FieldPanel('start_date'), FieldPanel('end_date')])], heading=gettext_lazy('Dates')), FieldPanel('reviewers', widget=CheckboxSelectMultiple), FieldPanel('submission_id_prefix'), ReadOnlyPanel('get_workflow_name_display', heading=gettext_lazy('Workflow'), help_text=gettext_lazy('Copied from the fund.')), ReadOnlyInlinePanel('forms', panels=[ReadOnlyPanel('name')], heading=gettext_lazy('Application forms'), help_text=gettext_lazy('Copied from the fund.')), ReadOnlyInlinePanel('review_forms', panels=[ReadOnlyPanel('name')], heading=gettext_lazy('Internal Review Form'), help_text=gettext_lazy('Copied from the fund.')), ReadOnlyInlinePanel('external_review_forms', panels=[ReadOnlyPanel('name')], help_text=gettext_lazy('Copied from the fund.'), heading=gettext_lazy('External Review Form')), ReadOnlyInlinePanel('determination_forms', panels=[ReadOnlyPanel('name')], help_text=gettext_lazy('Copied from the fund.'), heading=gettext_lazy('Determination Form'))]
edit_handler
class-attribute
instance-attribute
¶
edit_handler = TabbedInterface([ObjectList(content_panels, heading=gettext_lazy('Content')), ObjectList(promote_panels, heading=gettext_lazy('Promote'))])
is_open
property
¶
Checks if the application is open based on the current date.
The application is considered open if the current date is between the start and end dates (inclusive). If the end date is not set, the application is considered open if the current date is on or after the start date.
Returns:
-
bool
(bool
) –True if the application is open, False otherwise.
from_db
classmethod
¶
Deserialize form data when loading from database.
Parameters:
-
db
–Database connection
-
field_names
–List of field names being loaded
-
values
–Values for the fields
Returns:
-
–
Instance with deserialized form data
Source code in hypha/apply/stream_forms/models.py
deserialize_form_data
classmethod
¶
Convert stored form data back into Python objects.
Parameters:
-
instance
–Form instance
-
form_data
–Raw form data from database
-
form_fields
–Form field definitions
Returns:
-
–
Deserialized form data
Source code in hypha/apply/stream_forms/models.py
get_defined_fields
¶
get_form_fields
¶
Generate form fields with applied logic and grouping.
Parameters:
-
draft
–Whether this is a draft form. When True, fields that are not marked as ApplicationMustIncludeFieldBlock will have their required flag set to False, allowing incomplete form submissions to be saved as drafts.
-
form_data
–Existing form data
-
user
–User completing the form
Returns:
-
–
OrderedDict of form fields
Source code in hypha/apply/stream_forms/models.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
get_form_class
¶
Dynamically creates and returns a form class based on the field configuration.
Creates a new form class that inherits from submission_form_class (PageStreamBaseForm) and includes all the dynamically generated form fields.
Parameters:
-
draft
–Whether this is a draft form
-
form_data
–Existing form data for pre-populating form fields
-
user
–User completing the form, used for auto-populating user fields.
Returns:
-
–
A dynamically generated form class
Source code in hypha/apply/stream_forms/models.py
get_submission_class
¶
process_form_submission
¶
Source code in hypha/apply/funds/models/utils.py
render_landing_page
¶
Source code in hypha/apply/funds/models/utils.py
get_url
¶
Generates the live url, primarily used in the wagtail admin for the "view live" button.
Returns:
-
str
(Optional[str]
) –The live url of the page, or None if the page is not live.
Source code in hypha/apply/funds/models/applications.py
get_template
¶
get_landing_page_template
¶
fund
¶
save
¶
Source code in hypha/apply/funds/models/applications.py
get_submit_meta_data
¶
clean
¶
Source code in hypha/apply/funds/models/applications.py
get_initial_data_open_call_submission
¶
Source code in hypha/apply/funds/models/applications.py
get_form_parameters
¶
Source code in hypha/apply/funds/models/applications.py
get_form
¶
Source code in hypha/apply/funds/models/applications.py
serve
¶
Source code in hypha/apply/funds/models/applications.py
LabBase
¶
Bases: EmailForm
, WorkflowStreamForm
, SubmittableStreamForm
submission_form_class
class-attribute
instance-attribute
¶
submission_form_class = PageStreamBaseForm
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
WORKFLOW_CHOICES
class-attribute
instance-attribute
¶
WORKFLOW_CHOICES = {name: _0O8for (name, workflow) in items()}
workflow_name
class-attribute
instance-attribute
¶
workflow_name = CharField(choices=items(), max_length=100, default='single', verbose_name=gettext_lazy('Workflow'))
confirmation_text_extra
class-attribute
instance-attribute
¶
confirmation_text_extra = TextField(blank=True, help_text=gettext_lazy('Additional text for the application confirmation message.'))
email_confirmation_panels
class-attribute
instance-attribute
¶
email_confirmation_panels = [MultiFieldPanel([FieldRowPanel([FieldPanel('from_address', classname='col6'), FieldPanel('to_address', classname='col6')]), FieldPanel('subject'), FieldPanel('confirmation_text_extra')], heading=gettext_lazy('Confirmation email'))]
email_tab
class-attribute
instance-attribute
¶
email_tab = ObjectList(email_confirmation_panels, heading=gettext_lazy('Confirmation email'))
lead
class-attribute
instance-attribute
¶
lead = ForeignKey(AUTH_USER_MODEL, limit_choices_to=LIMIT_TO_STAFF, related_name='lab_lead', on_delete=PROTECT)
submission_id_prefix
class-attribute
instance-attribute
¶
submission_id_prefix = SlugField(gettext_lazy('Submission ID Prefix'), max_length=10, blank=True, default='', null=False, help_text=gettext_lazy('Prefix for the submission id. e.g. "HYPHA23-" will result in a submission id of "HYPHA23-1".'))
reviewers
class-attribute
instance-attribute
¶
reviewers = ParentalManyToManyField(AUTH_USER_MODEL, related_name='labs_reviewer', limit_choices_to=LIMIT_TO_REVIEWERS, blank=True)
image
class-attribute
instance-attribute
¶
image = ForeignKey('images.CustomImage', null=True, blank=True, on_delete=SET_NULL, related_name='+')
weight
class-attribute
instance-attribute
¶
weight = PositiveIntegerField(default=1, blank=True, validators=[MinValueValidator(1), MaxValueValidator(100)])
guide_link
class-attribute
instance-attribute
¶
guide_link = URLField(blank=True, max_length=255, help_text=gettext_lazy('Link to the apply guide.'))
slack_channel
class-attribute
instance-attribute
¶
slack_channel = CharField(blank=True, max_length=128, help_text=gettext_lazy('The slack #channel for notifications.'))
activity_digest_recipient_emails
class-attribute
instance-attribute
¶
activity_digest_recipient_emails = ArrayField(EmailField(default=''), blank=True, null=True, help_text=gettext_lazy('Comma separated list of emails where a summary of all the activities related to this lab will be sent.'))
list_on_front_page
class-attribute
instance-attribute
¶
list_on_front_page = BooleanField(default=True, help_text=gettext_lazy('Should the lab be listed on the front page.'))
parent_page_types
class-attribute
instance-attribute
¶
content_panels
class-attribute
instance-attribute
¶
content_panels = content_panels + [FieldPanel('lead'), FieldPanel('reviewers', widget=CheckboxSelectMultiple), FieldPanel('guide_link'), FieldPanel('description'), FieldPanel('image'), FieldPanel('weight'), FieldPanel('slack_channel'), FieldPanel('submission_id_prefix'), FieldPanel('activity_digest_recipient_emails'), FieldPanel('list_on_front_page')]
edit_handler
class-attribute
instance-attribute
¶
edit_handler = TabbedInterface([ObjectList(content_panels, heading=gettext_lazy('Content')), email_tab, ObjectList(promote_panels, heading=gettext_lazy('Promote'))])
from_db
classmethod
¶
Deserialize form data when loading from database.
Parameters:
-
db
–Database connection
-
field_names
–List of field names being loaded
-
values
–Values for the fields
Returns:
-
–
Instance with deserialized form data
Source code in hypha/apply/stream_forms/models.py
deserialize_form_data
classmethod
¶
Convert stored form data back into Python objects.
Parameters:
-
instance
–Form instance
-
form_data
–Raw form data from database
-
form_fields
–Form field definitions
Returns:
-
–
Deserialized form data
Source code in hypha/apply/stream_forms/models.py
get_defined_fields
¶
get_form_fields
¶
Generate form fields with applied logic and grouping.
Parameters:
-
draft
–Whether this is a draft form. When True, fields that are not marked as ApplicationMustIncludeFieldBlock will have their required flag set to False, allowing incomplete form submissions to be saved as drafts.
-
form_data
–Existing form data
-
user
–User completing the form
Returns:
-
–
OrderedDict of form fields
Source code in hypha/apply/stream_forms/models.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
get_form_class
¶
Dynamically creates and returns a form class based on the field configuration.
Creates a new form class that inherits from submission_form_class (PageStreamBaseForm) and includes all the dynamically generated form fields.
Parameters:
-
draft
–Whether this is a draft form
-
form_data
–Existing form data for pre-populating form fields
-
user
–User completing the form, used for auto-populating user fields.
Returns:
-
–
A dynamically generated form class
Source code in hypha/apply/stream_forms/models.py
get_submission_class
¶
process_form_submission
¶
Source code in hypha/apply/funds/models/utils.py
render_landing_page
¶
Source code in hypha/apply/funds/models/utils.py
send_mail
¶
get_submit_meta_data
¶
open_round
¶
get_form
¶
Source code in hypha/apply/funds/models/applications.py
serve
¶
Source code in hypha/apply/funds/models/applications.py
RoundsAndLabsProgressQueryset
¶
RoundsAndLabsManager
¶
Bases: PageManager
get_queryset
¶
get_queryset(base_queryset=RoundsAndLabsQueryset)
Source code in hypha/apply/funds/models/applications.py
with_progress
¶
Source code in hypha/apply/funds/models/applications.py
open
¶
closed
¶
new
¶
RoundsAndLabs
¶
Bases: Page
This behaves as a useful way to get all the rounds and labs that are defined in the project regardless of how they are implemented (lab/round/sealed_round)