Views
hypha.apply.activity.views
¶
ActivityContextMixin
¶
Mixin to add related 'comments' of the current view's 'self.object'
get_context_data
¶
Source code in hypha/apply/activity/views.py
CommentFormView
¶
Bases: DelegatedViewMixin
, CreateView
setup
¶
get_object
¶
Source code in hypha/apply/utils/views.py
get_template_names
¶
get_form_name
¶
get_parent_kwargs
¶
get_parent_object
¶
get_form
¶
get_context_data
¶
Source code in hypha/apply/utils/views.py
is_model_form
classmethod
¶
contribute_form
¶
Source code in hypha/apply/utils/views.py
form_valid
¶
Source code in hypha/apply/activity/views.py
get_success_url
¶
get_form_kwargs
¶
Get the kwargs for the CommentForm
.
Returns:
-
dict
–A dict of kwargs to be passed to
CommentForm
. -
dict
–The submission instance is removed from this return, while a boolean of
has_partners
is -
dict
–added based off the submission.
Source code in hypha/apply/activity/views.py
AttachmentView
¶
Bases: PrivateMediaView
NotificationsView
¶
Bases: ListView
get_template_names
¶
get_queryset
¶
Source code in hypha/apply/activity/views.py
partial_comments
¶
Render a partial view of comments for a given content type and primary key.
This view handles comments for both 'submission' and 'project' content types. It checks the user's permissions and fetches the related comments for the user. The comments are paginated and rendered in the 'comment_list' template.
Parameters:
-
request
(HttpRequest
) –The HTTP request object.
-
content_type
(str
) –The type of content ('submission' or 'project').
-
pk
(int
) –The primary key of the content object.
Returns:
-
HttpResponse
–The rendered 'comment_list' template with the context data.
Source code in hypha/apply/activity/views.py
edit_comment
¶
Edit a comment.