EighthSignup¶
Qualified name: intranet.apps.eighth.models.EighthSignup
- class intranet.apps.eighth.models.EighthSignup(*args, **kwargs)[source]¶
Bases:
AbstractBaseEighthModel
Represents a signup/membership in an eighth period activity. .. attribute:: user
The
User
who has signed up.- scheduled_activity¶
The
EighthScheduledActivity
for 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 (
ForeignKey
toUser
) – User (related name:eighthsignup
)scheduled_activity (
ForeignKey
toEighthScheduledActivity
) – 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_time
Finds next instance based on
time
.get_previous_by_time
Finds 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.
save
Save model without saving a historical record
Checked whether more than one EighthSignup exists for a User on a given EighthBlock.
Attributes
Type:
BooleanField
Type:
BooleanField
Type:
BooleanField
archived_was_absent
Type:
BooleanField
history
id
Type:
AutoField
objects
own_signup
Type:
BooleanField
Type:
BooleanField
Type:
CharField
Type:
CharField
Type:
ForeignKey
toEighthScheduledActivity
scheduled_activity_id
Internal field, use
scheduled_activity
instead.time
Type:
DateTimeField
user
Type:
ForeignKey
toUser
user_id
Internal field, use
user
instead.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 = 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 model without saving a historical record
Make sure you know what you’re doing before you use this method.