Views
hypha.apply.api.v1.review.views
¶
SubmissionReviewViewSet
¶
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, HasReviewCreatePermission, IsApplyStaffUser], 'retrieve': [IsAuthenticated, HasReviewDetailPermission, IsApplyStaffUser], 'update': [IsAuthenticated, HasReviewEditPermission, IsApplyStaffUser], 'delete': [IsAuthenticated, HasReviewDeletePermission, IsApplyStaffUser], 'opinions': [IsAuthenticated, HasReviewOpinionPermission, IsApplyStaffUser], 'fields': [IsAuthenticated, HasReviewCreatePermission, IsApplyStaffUser], 'draft': [IsAuthenticated, HasReviewDraftPermission, IsApplyStaffUser]}
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_fields
¶
Source code in hypha/apply/stream_forms/models.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 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 |
|
get_form_class
¶
get_permissions
¶
Source code in hypha/apply/api/v1/review/views.py
get_defined_fields
¶
Get form fields created for reviewing this submission.
These form fields will be used to get respective serializer fields.
Source code in hypha/apply/api/v1/review/views.py
get_serializer_class
¶
Override get_serializer_class to send draft parameter if the request is to save as draft or the review submitted is saved as draft.
Source code in hypha/apply/api/v1/review/views.py
get_queryset
¶
get_object
¶
Get the review object by id. If not found raise 404.
Source code in hypha/apply/api/v1/review/views.py
get_reviewer
¶
Get the AssignedReviewers for the current user on a submission.
Source code in hypha/apply/api/v1/review/views.py
create
¶
Create a review 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 review is to be saved as draft.
Raise ValidationError if a review is already submitted by the user.
Source code in hypha/apply/api/v1/review/views.py
get_review_data
¶
Get review data which will be used for review detail api.
Source code in hypha/apply/api/v1/review/views.py
retrieve
¶
Get details of a review on a submission
update
¶
Update a review submitted on a submission.
Source code in hypha/apply/api/v1/review/views.py
destroy
¶
Delete a review on a submission
Source code in hypha/apply/api/v1/review/views.py
get_review_by_reviewer
¶
draft
¶
Returns the draft review submitted on a submission by current user.
Source code in hypha/apply/api/v1/review/views.py
fields
¶
List details of all the form fields that were created by admin for adding reviews.
These field details will be used in frontend to render the review form.
Source code in hypha/apply/api/v1/review/views.py
opinions
¶
Used to add opinions on a review.
Options are 0 and 1. DISAGREE = 0 AGREE = 1
Response is similar to detail api of the review.