Report
hypha.apply.projects.models.report
¶
ReportQueryset
¶
Bases: QuerySet
done
¶
to_do
¶
any_very_late
¶
submitted
¶
for_table
¶
Source code in hypha/apply/projects/models/report.py
Report
¶
Bases: BaseStreamForm
, AccessFormData
, Model
submission_form_class
class-attribute
instance-attribute
¶
submission_form_class = PageStreamBaseForm
project
class-attribute
instance-attribute
¶
form_fields
class-attribute
instance-attribute
¶
form_fields = StreamField(ProjectFormCustomFormFieldsBlock(), use_json_field=True, null=True)
form_data
class-attribute
instance-attribute
¶
form_data = JSONField(encoder=StreamFieldDataEncoder, default=dict)
current
class-attribute
instance-attribute
¶
current = OneToOneField('ReportVersion', on_delete=CASCADE, related_name='live_for_report', null=True)
draft
class-attribute
instance-attribute
¶
draft = OneToOneField('ReportVersion', on_delete=CASCADE, related_name='draft_for_report', null=True)
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
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
get_absolute_url
¶
start_date
¶
ReportVersion
¶
Bases: BaseStreamForm
, AccessFormData
, Model
submission_form_class
class-attribute
instance-attribute
¶
submission_form_class = PageStreamBaseForm
report
class-attribute
instance-attribute
¶
form_data
class-attribute
instance-attribute
¶
form_data = JSONField(encoder=StreamFieldDataEncoder, default=dict)
author
class-attribute
instance-attribute
¶
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
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
ReportPrivateFiles
¶
Bases: Model
report
class-attribute
instance-attribute
¶
document
class-attribute
instance-attribute
¶
document = FileField(upload_to=report_path, storage=PrivateStorage())
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
ReportConfig
¶
Bases: Model
Persists configuration about the reporting schedule etc
FREQUENCY_CHOICES
class-attribute
instance-attribute
¶
FREQUENCY_CHOICES = [(WEEK, gettext_lazy('Weeks')), (MONTH, gettext_lazy('Months')), (YEAR, gettext_lazy('Years'))]
project
class-attribute
instance-attribute
¶
frequency
class-attribute
instance-attribute
¶
frequency = CharField(choices=FREQUENCY_CHOICES, default=MONTH, max_length=6)
disable_reporting
class-attribute
instance-attribute
¶
get_frequency_display
¶
Source code in hypha/apply/projects/models/report.py
is_up_to_date
¶
outstanding_reports
¶
has_very_late_reports
¶
past_due_reports
¶
last_report
¶
Source code in hypha/apply/projects/models/report.py
current_due_report
¶
Source code in hypha/apply/projects/models/report.py
current_report
¶
This is different from current_due_report as it will return a completed report if that one is the current one.