Models
hypha.apply.activity.models
¶
ACTIVITY_TYPES
module-attribute
¶
VISIBILITY
module-attribute
¶
VISIBILITY = {APPLICANT: gettext('Applicants'), TEAM: gettext('Staff only'), REVIEWER: gettext('Reviewers'), PARTNER: gettext('Partners'), ALL: gettext('All'), APPLICANT_PARTNERS: gettext('Applicants & Partners')}
BaseActivityQuerySet
¶
Bases: QuerySet
visible_to
¶
Get a QuerySet of all items that are visible to the given user.
Parameters:
-
user
–User
to filter visibility of
Returns:
-
QuerySet
–A QuerySet containing all items visible to the specified user
Source code in hypha/apply/activity/models.py
ActivityQuerySet
¶
Bases: BaseActivityQuerySet
visible_to
¶
Get a QuerySet of all items that are visible to the given user.
Parameters:
-
user
–User
to filter visibility of
Returns:
-
QuerySet
–A QuerySet containing all items visible to the specified user
Source code in hypha/apply/activity/models.py
newer
¶
comments
¶
actions
¶
CommentQueryset
¶
Bases: BaseActivityQuerySet
CommentManger
¶
Bases: ActivityBaseManager
create
¶
ActionQueryset
¶
Bases: BaseActivityQuerySet
ActionManager
¶
Bases: ActivityBaseManager
create
¶
ActivityAttachment
¶
Bases: Model
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
uuid
class-attribute
instance-attribute
¶
activity
class-attribute
instance-attribute
¶
file
class-attribute
instance-attribute
¶
file = FileField(upload_to=get_attachment_upload_path, storage=PrivateStorage())
Activity
¶
Bases: Model
source_content_type
class-attribute
instance-attribute
¶
source_content_type = ForeignKey(ContentType, blank=True, null=True, on_delete=CASCADE, related_name='activity_source')
source_object_id
class-attribute
instance-attribute
¶
source
class-attribute
instance-attribute
¶
visibility
class-attribute
instance-attribute
¶
visibility = CharField(choices=list(items()), default=APPLICANT, max_length=30)
previous
class-attribute
instance-attribute
¶
related_content_type
class-attribute
instance-attribute
¶
related_content_type = ForeignKey(ContentType, blank=True, null=True, on_delete=CASCADE, related_name='activity_related')
related_object_id
class-attribute
instance-attribute
¶
related_object
class-attribute
instance-attribute
¶
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
Meta
¶
get_absolute_url
¶
visibility_for
classmethod
¶
Gets activity visibility for a specified user
Takes an optional boolean that is used to determine the visibility of an application comment. This was mainly implemented to allow partners also holding the role of applicant to have a proper visibility.
ie. Prevent someone with the role of partner & applicant looking at comments on their own application and seeing partner visibility
Parameters:
-
user
–User
to get visibility for -
is_submission_author
(Optional[bool]
, default:False
) –boolean used when the
user
is the applicant of the source activity
Returns:
-
List[str]
–A list of visibility strings
Source code in hypha/apply/activity/models.py
visibility_choices_for
classmethod
¶
Gets activity visibility choices for the specified user
Uses the given user (and partner query set if provided) to give the specified user activity visibility choices.
Parameters:
-
user
–The
User
being given visibility choices -
submission_has_partner
–An optional QuerySet of partners (
Users
)
Source code in hypha/apply/activity/models.py
Event
¶
Bases: Model
Model to track when messages are triggered