EnrichmentActivity¶
Qualified name: intranet.apps.enrichment.models.EnrichmentActivity
- class intranet.apps.enrichment.models.EnrichmentActivity(*args, **kwargs)[source]¶
Bases:
ModelAn 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 (
ForeignKeytoUser) – User (related name:enrichmentactivity)attending (
ManyToManyFieldtoUser) – Attending (related name:enrichments_attending)attended (
ManyToManyFieldtoUser) – Attended (related name:enrichments_attended)groups_allowed (
ManyToManyFieldtoGroup) – Groups allowed (related name:allowed_enrichments_set)groups_blacklisted (
ManyToManyFieldtoGroup) – Groups blacklisted (related name:blacklisted_enrichments_set)
Methods
get_next_by_addedFinds next instance based on
added.get_previous_by_addedFinds previous instance based on
added.Return whether a user can sign up for an enrichment activity.
user_is_blacklistedAttributes
addedType:
DateTimeFieldattendance_takenType:
BooleanFieldattendedType:
ManyToManyFieldtoUserattendingType:
ManyToManyFieldtoUsercapacityType:
SmallIntegerFielddescriptionType:
TextFieldgroups_allowedType:
ManyToManyFieldtoGroupgroups_blacklistedType:
ManyToManyFieldtoGroupReturn whether an enrichment activity has happened.
idType:
AutoFieldReturn 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.
locationType:
CharFieldobjectspresignType:
BooleanFieldrestrictedtimeType:
DateTimeFieldtitleType:
CharFielduserType:
ForeignKeytoUseruser_idInternal field, use
userinstead.- 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.