Views
hypha.apply.api.v1.determination.views
¶
SubmissionDeterminationViewSet
¶
Bases: BaseStreamForm
, WagtailSerializer
, SubmissionNestedMixin
, GenericViewSet
submission_form_class
class-attribute
instance-attribute
¶
submission_form_class = PageStreamBaseForm
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
permission_classes
class-attribute
instance-attribute
¶
permission_classes = (IsAuthenticated, IsApplyStaffUser)
permission_classes_by_action
class-attribute
instance-attribute
¶
permission_classes_by_action = {'create': [IsAuthenticated, HasDeterminationCreatePermission, IsApplyStaffUser], 'draft': [IsAuthenticated, HasDeterminationDraftPermission, IsApplyStaffUser]}
serializer_class
class-attribute
instance-attribute
¶
serializer_class = SubmissionDeterminationSerializer
get_submission_object
¶
get_serializer_fields
¶
Get the respective serializer fields for all the form fields.
Source code in hypha/apply/api/v1/stream_serializers.py
find_function_args
¶
Get the list of parameter names which function accepts.
Source code in hypha/apply/api/v1/stream_serializers.py
find_class_args
¶
Find all class arguments (parameters) which can be passed in __init__
.
Source code in hypha/apply/api/v1/stream_serializers.py
find_matching_class_kwargs
¶
get_serializer_field_class
¶
Assumes that a serializer field exist with the same name as form field.
TODO: In case there are form fields not existing in serializer fields, we would have to create mapping b/w form fields and serializer fields to get the respective classes. But for now this works.
Source code in hypha/apply/api/v1/stream_serializers.py
from_db
classmethod
¶
Source code in hypha/apply/stream_forms/models.py
deserialize_form_data
classmethod
¶
Source code in hypha/apply/stream_forms/models.py
get_form_class
¶
get_permissions
¶
Source code in hypha/apply/api/v1/determination/views.py
get_defined_fields
¶
Get form fields created for determining this submission.
These form fields will be used to get respective serializer fields.
Source code in hypha/apply/api/v1/determination/views.py
get_serializer_class
¶
Override get_serializer_class to send draft parameter if the request is to save as draft or the determination submitted is saved as draft.
Source code in hypha/apply/api/v1/determination/views.py
get_queryset
¶
get_object
¶
Get the determination object by id. If not found raise 404.
Source code in hypha/apply/api/v1/determination/views.py
get_determination_data
¶
Get determination data which will be used for determination detail api.
Source code in hypha/apply/api/v1/determination/views.py
retrieve
¶
Get details of a determination on a submission
Source code in hypha/apply/api/v1/determination/views.py
get_form_fields
¶
Source code in hypha/apply/api/v1/determination/views.py
fields
¶
List details of all the form fields that were created by admin for adding determinations.
These field details will be used in frontend to render the determination form.
Source code in hypha/apply/api/v1/determination/views.py
get_draft_determination
¶
Source code in hypha/apply/api/v1/determination/views.py
draft
¶
Returns the draft determination submitted on a submission by current user.
Source code in hypha/apply/api/v1/determination/views.py
create
¶
Create a determination on a submission.
Accept a post data in form of {field_id: value}
.
field_id
is same id which you get from the /fields
api.
value
should be submitted with html tags, so that response can
be displayed with correct formatting, e.g. in case of rich text field,
we need to show the data with same formatting user has submitted.
Accepts optional parameter is_draft
when a determination is to be saved as draft.
Raise ValidationError if a determination is already submitted by the user.
Source code in hypha/apply/api/v1/determination/views.py
update
¶
Update a determination submitted on a submission.