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:

Relationship fields:

Parameters:

Methods

get_next_by_added

Finds next instance based on added.

get_previous_by_added

Finds previous instance based on added.

user_can_signup

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 to User

attending

Type: ManyToManyField to User

capacity

Type: SmallIntegerField

description

Type: TextField

groups_allowed

Type: ManyToManyField to Group

groups_blacklisted

Type: ManyToManyField to Group

happened

Return whether an enrichment activity has happened.

id

Type: AutoField

is_this_year

Return whether the enrichment activity was created after the start of the school year.

is_too_early_to_signup

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 to User

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.

user_can_signup(user)[source]

Return whether a user can sign up for an enrichment activity.

Parameters:

user – The user to check.

Returns:

Whether the user can sign up for the enrichment activity.