EighthSignup¶
Qualified name: intranet.apps.eighth.models.EighthSignup
- class intranet.apps.eighth.models.EighthSignup(*args, **kwargs)[source]¶
Bases:
AbstractBaseEighthModelRepresents a signup/membership in an eighth period activity. .. attribute:: user
The
Userwho has signed up.- scheduled_activity¶
The
EighthScheduledActivityfor which the user has signed up.
- after_deadline¶
Whether the signup was after deadline.
- previous_activity_name¶
The name of the activity the student was previously signed up for (used for passes)
- previous_activity_sponsors¶
The sponsors of the activity the student was previously signed up for.
- pass_accepted¶
Whether the pass was accepted
- was_absent¶
Whether the student was absent.
- absence_acknowledged¶
Whether the student has dismissed the absence notification.
- absence_emailed¶
Whether the student has been emailed about the absence.
- Parameters:
id (AutoField) – Primary key: ID
created_time (DateTimeField) – Created time
last_modified_time (DateTimeField) – Last modified time
time (DateTimeField) – Time
after_deadline (BooleanField) – After deadline
previous_activity_name (CharField) – Previous activity name
previous_activity_sponsors (CharField) – Previous activity sponsors
pass_accepted (BooleanField) – Pass accepted
was_absent (BooleanField) – Was absent
absence_acknowledged (BooleanField) – Absence acknowledged
absence_emailed (BooleanField) – Absence emailed
archived_was_absent (BooleanField) – Archived was absent
own_signup (BooleanField) – Own signup
Relationship fields:
- Parameters:
user (
ForeignKeytoUser) – User (related name:eighthsignup)scheduled_activity (
ForeignKeytoEighthScheduledActivity) – Scheduled activity (related name:eighthsignup_set)
Methods
Accepts an eighth period pass for the EighthSignup object.
If user was absent, archives the absence.
get_next_by_timeFinds next instance based on
time.get_previous_by_timeFinds previous instance based on
time.Returns True if another EighthSignup object exists for the same user in the same block.
Returns whether the block for this signup is in the clear absence period.
Rejects an eighth period pass for the EighthSignup object.
Attempts to remove the EighthSignup if the user has permission to do so.
saveSave the model instance without creating a historical record.
Checked whether more than one EighthSignup exists for a User on a given EighthBlock.
Attributes
Type:
BooleanFieldType:
BooleanFieldType:
BooleanFieldarchived_was_absentType:
BooleanFieldcreated_timeType:
DateTimeFieldhistoryidType:
AutoFieldlast_modified_timeType:
DateTimeFieldobjectsown_signupType:
BooleanFieldType:
BooleanFieldType:
CharFieldType:
CharFieldType:
ForeignKeytoEighthScheduledActivityscheduled_activity_idInternal field, use
scheduled_activityinstead.timeType:
DateTimeFielduserType:
ForeignKeytoUseruser_idInternal field, use
userinstead.Type:
BooleanField- has_conflict(nocache: bool = False) bool[source]¶
Returns True if another EighthSignup object exists for the same user in the same block. :param nocache: Whether to explicitly disable caching for this check.
- Returns:
Whether there is another EighthSignup for the same user in the same block.
- in_clear_absence_period() bool[source]¶
Returns whether the block for this signup is in the clear absence period. :returns: Whether the block for this signup is in the clear absence period.
- remove_signup(user: User = None, force: bool = False, dont_run_waitlist: bool = False) str[source]¶
Attempts to remove the EighthSignup if the user has permission to do so. :param user: The user who is attempting to remove the EighthSignup. :param force: Whether to force removal. :param dont_run_waitlist: Whether to skip notifying users on the activity’s waitlist.
- Returns:
A message to be displayed to the user indicating successful removal.
- save_without_historical_record(*args, **kwargs)¶
Save the model instance without creating a historical record.
Make sure you know what you’re doing before using this method.