EnrichmentActivity¶
Qualified name: intranet.apps.enrichment.models.EnrichmentActivity
- class intranet.apps.enrichment.models.EnrichmentActivity(*args, **kwargs)[source]¶
Bases:
Model
An enrichment activity available to the TJ community.
- Parameters:
id (AutoField) – Primary key: ID
title (CharField) – Title
description (TextField) – Description
added (DateTimeField) – Added
time (DateTimeField) – Time
location (CharField) – Location
capacity (SmallIntegerField) – Capacity
attendance_taken (BooleanField) – Attendance taken
presign (BooleanField) – Presign
Relationship fields:
- Parameters:
user (
ForeignKey
toUser
) – User (related name:enrichmentactivity
)attending (
ManyToManyField
toUser
) – Attending (related name:enrichments_attending
)attended (
ManyToManyField
toUser
) – Attended (related name:enrichments_attended
)groups_allowed (
ManyToManyField
toGroup
) – Groups allowed (related name:allowed_enrichments_set
)groups_blacklisted (
ManyToManyField
toGroup
) – Groups blacklisted (related name:blacklisted_enrichments_set
)
Methods
get_next_by_added
Finds next instance based on
added
.get_previous_by_added
Finds previous instance based on
added
.Return whether a user can sign up for an enrichment activity.
user_is_blacklisted
Attributes
added
Type:
DateTimeField
attendance_taken
Type:
BooleanField
attended
Type:
ManyToManyField
toUser
attending
Type:
ManyToManyField
toUser
capacity
Type:
SmallIntegerField
description
Type:
TextField
groups_allowed
Type:
ManyToManyField
toGroup
groups_blacklisted
Type:
ManyToManyField
toGroup
Return whether an enrichment activity has happened.
id
Type:
AutoField
Return whether the enrichment activity was created after the start of the school year.
Returns whether it is too early to sign up for the activity if it is a presign.
location
Type:
CharField
objects
presign
Type:
BooleanField
restricted
time
Type:
DateTimeField
title
Type:
CharField
user
Type:
ForeignKey
toUser
user_id
Internal field, use
user
instead.- property happened¶
Return whether an enrichment activity has happened.
- property is_this_year¶
Return whether the enrichment activity was created after the start of the school year.
- property is_too_early_to_signup¶
Returns whether it is too early to sign up for the activity if it is a presign. This contains the 2 day presign logic.
- Returns:
Whether it is too early to sign up for this scheduled activity and when the activity opens for signups.