EighthWaitlistManager¶
Qualified name: intranet.apps.eighth.models.EighthWaitlistManager
- class intranet.apps.eighth.models.EighthWaitlistManager(*args, **kwargs)[source]¶
Bases:
Manager
Model manager for EighthWaitlist.
Methods
Returns whether the given user is in a waitlist for the given activity.
Returns a QuerySet of all the EighthWaitlist objects for the given activity, ordered by signup time.
Given an activity ID and a user ID, returns the user's position in the waitlist (starting at 1).
Attributes
- check_for_prescence(activity: EighthScheduledActivity, user: User) bool [source]¶
Returns whether the given user is in a waitlist for the given activity. :param activity: The activity for which the waitlist should be queried. :param user: The user who should be searched for in the activity’s waitlist.
- Returns:
Whether the given user is in a waitlist for the given activity.
- get_next_waitlist(activity: EighthScheduledActivity) QuerySet | Collection[EighthWaitlist] [source]¶
Returns a QuerySet of all the EighthWaitlist objects for the given activity, ordered by signup time. :param activity: The activity to list the EighthWaitlist objects for.
- Returns:
A QuerySet of all the EighthWaitlist objects for the given activity, ordered by signup time.
- position_in_waitlist(aid: int, uid: int) int [source]¶
Given an activity ID and a user ID, returns the user’s position in the waitlist (starting at 1). If the user is not in the waitlist, returns 0. :param aid: The ID of the EighthScheduledActivity for which the waitlist should be queried. :param uid: The ID of the user whose position in the waitlist should be found.
- Returns:
The user’s position in the waitlist, starting at 1, or 0 if the user is not in the waitlist.