Submissions
hypha.apply.funds.models.submissions
¶
JSONOrderable
¶
Bases: QuerySet
order_by
¶
Source code in hypha/apply/funds/models/submissions.py
ApplicationSubmissionQueryset
¶
Bases: JSONOrderable
order_by
¶
Source code in hypha/apply/funds/models/submissions.py
active
¶
inactive
¶
in_community_review
¶
Source code in hypha/apply/funds/models/submissions.py
in_review
¶
in_review_for
¶
Source code in hypha/apply/funds/models/submissions.py
for_reviewer_settings
¶
Source code in hypha/apply/funds/models/submissions.py
reviewed_by
¶
flagged_by
¶
flagged_staff
¶
partner_for
¶
awaiting_determination_for
¶
undetermined
¶
current
¶
archived
¶
include_archive
¶
current_accepted
¶
value
¶
exclude_draft
¶
with_latest_update
¶
Source code in hypha/apply/funds/models/submissions.py
for_table
¶
Source code in hypha/apply/funds/models/submissions.py
AddTransitions
¶
Bases: ModelBase
ApplicationSubmissionMetaclass
¶
Bases: AddTransitions
ApplicationSubmission
¶
Bases: WorkflowHelpers
, BaseStreamForm
, AccessFormData
, AbstractFormSubmission
submission_form_class
class-attribute
instance-attribute
¶
submission_form_class = PageStreamBaseForm
WORKFLOW_CHOICES
class-attribute
instance-attribute
¶
WORKFLOW_CHOICES = {name: _sGafor (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'))
form_data
class-attribute
instance-attribute
¶
form_data = JSONField(encoder=StreamFieldDataEncoder)
form_fields
class-attribute
instance-attribute
¶
form_fields = StreamField(ApplicationCustomFormFieldsBlock(), use_json_field=True)
public_id
class-attribute
instance-attribute
¶
round
class-attribute
instance-attribute
¶
lead
class-attribute
instance-attribute
¶
lead = ForeignKey(AUTH_USER_MODEL, limit_choices_to=LIMIT_TO_STAFF, related_name='submission_lead', on_delete=PROTECT)
next
class-attribute
instance-attribute
¶
reviewers
class-attribute
instance-attribute
¶
reviewers = ManyToManyField(AUTH_USER_MODEL, related_name='submissions_reviewer', blank=True, through='AssignedReviewers')
partners
class-attribute
instance-attribute
¶
partners = ManyToManyField(AUTH_USER_MODEL, related_name='submissions_partner', limit_choices_to=LIMIT_TO_PARTNERS, blank=True)
meta_terms
class-attribute
instance-attribute
¶
meta_terms = ManyToManyField(MetaTerm, related_name='submissions', blank=True)
flags
class-attribute
instance-attribute
¶
flags = GenericRelation(Flag, content_type_field='target_content_type', object_id_field='target_object_id', related_query_name='submission')
activities
class-attribute
instance-attribute
¶
activities = GenericRelation('activity.Activity', content_type_field='source_content_type', object_id_field='source_object_id', related_query_name='submission')
user
class-attribute
instance-attribute
¶
status
class-attribute
instance-attribute
¶
status = FSMField(default=INITIAL_STATE, protected=True)
screening_statuses
class-attribute
instance-attribute
¶
screening_statuses = ManyToManyField('funds.ScreeningStatus', related_name='submissions', blank=True)
submit_time
class-attribute
instance-attribute
¶
live_revision
class-attribute
instance-attribute
¶
live_revision = OneToOneField('ApplicationRevision', on_delete=CASCADE, related_name='live', null=True, editable=False)
draft_revision
class-attribute
instance-attribute
¶
draft_revision = OneToOneField('ApplicationRevision', on_delete=CASCADE, related_name='draft', null=True, editable=False)
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
title_text_display
property
¶
Return the title text for display across the site.
Use SUBMISSION_TITLE_TEXT_TEMPLATE setting to change format.
is_determination_form_attached
property
¶
We use old django determination forms but now as we are moving to streamfield determination forms which can be created and attached to funds in admin.
This method checks if there are new determination forms attached to the submission or we would still use the old determination forms for backward compatibility.
Meta
¶
stream_file
classmethod
¶
Source code in hypha/apply/funds/models/mixins.py
process_file
classmethod
¶
process_file_data
¶
Source code in hypha/apply/funds/models/mixins.py
extract_files
¶
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
deserialised_data
classmethod
¶
Source code in hypha/apply/funds/models/mixins.py
get_definitive_id
¶
field
¶
data
¶
get_serialize_multi_inputs_answer
¶
Source code in hypha/apply/funds/models/mixins.py
serialize
¶
Source code in hypha/apply/funds/models/mixins.py
get_multi_inputs_answer
¶
Source code in hypha/apply/funds/models/mixins.py
render_answer
¶
Source code in hypha/apply/funds/models/mixins.py
render_answers
¶
render_first_group_text_answers
¶
render_text_blocks_answers
¶
Source code in hypha/apply/funds/models/mixins.py
output_answers
¶
output_text_answers
¶
output_first_group_text_answers
¶
get_answer_from_label
¶
Source code in hypha/apply/funds/models/mixins.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 the form field definitions.
Returns:
-
–
StreamField containing form field blocks
Raises:
-
AttributeError
–If form_fields attribute is not defined on instance
Source code in hypha/apply/stream_forms/models.py
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
not_progressed
¶
restart_stage
¶
If running form the console please include your user using the kwarg "by"
u = User.objects.get(email="my@email.com") for a in ApplicationSubmission.objects.all(): a.restart_stage(by=u) a.save()
Source code in hypha/apply/funds/models/submissions.py
|
ensure_user_has_account
¶
Source code in hypha/apply/funds/models/submissions.py
get_from_parent
¶
progress_application
¶
Source code in hypha/apply/funds/models/submissions.py
from_draft
¶
Sets current form_data
to the form_data
from the draft revision.
Returns:
-
Self
–Self with the
form_data
attribute updated.
Source code in hypha/apply/funds/models/submissions.py
create_revision
¶
Create a new revision on the submission
This is used to save drafts, track changes when an RFI is made and save changes before rendering a preview
Parameters:
-
draft
–if the revision is a draft
-
force
–force a revision even if form data is the same
-
by
(Optional[AnonymousUser | AbstractBaseUser]
, default:None
) –the author of the revision
-
preview
–if the revision is being used to save befor a preview
Returns:
-
Optional[Model]
–Returns the
ApplicationRevision
if it was created, otherwise returnsNone