Volunteering system
The volunteering system allows us to manage volunteers at EMF. You can find more detail on these models are used in the volunteering app docs.
Volunteer
Roles
- class models.volunteer.role.Role(**kwargs)[source]
A role which a volunteer can perform.
- slug: Mapped[str][source]
A short, stable, urlsafe, identifier used for de-duplication during data seeding.
- name: Mapped[str][source]
The name used to present a role. Should be kept short as it gets used in lists.
- full_description_md: Mapped[str | None][source]
A longer description of the role, supports Markdown.
- instructions_url: Mapped[str | None][source]
A link to some instructions on how to perform the role.
- shift_templates: Mapped[list[ShiftTemplate]][source]
Shift templates used to generate the full shift schedule for this role
- shifts_finalised: Mapped[bool][source]
Whether shift timings have been finalised. Once finalised no further changes can be made via shift templates as the role will be made available to attendees for shift signup.
- classmethod grouped_by_team(only=None)[source]
Return a list of roles, and their shift counts, grouped by the team they sit under.
If only is passed then only roles within the pass list of IDs will be returned, this is primarily intended to scope this to the list of roles a user has admin privileges for.
- Return type:
dict[Team,list[tuple[Role,int]]]
Shifts
- class models.volunteer.shift.Shift(**kwargs)[source]
An available shift for one or more volunteers to perform.
- venue: Mapped[VolunteerVenue][source]
Venue where the shift occurs
- occurrence: Mapped[Occurrence][source]
Optional Occurrence (talk/workshop) related to this shift
- entries: Mapped[list[ShiftEntry]][source]
Entries (volunteers) for this shift
- is_clash(other)[source]
Calculate whether this shift clashes with another.
We use this to determine if we should allow a volunteer to sign up for both shifts, which is only permitted if the other shift is filling the same role in the same venue. In all other cases a volunteer can’t sign up for two shifts at the same time.
This is needed because contiguous shifts often have a slight overlap.
- classmethod get_all_for_day(day, *, include_unfinalised=False)[source]
Return all shifts for the requested day.
For the purposes of shifts we consider a day to run from 04:00-03:59 so that late night shifts get shown in the context of the day leading up to them.
If include_unfinalised is True than all shifts will be returned, otherwise only those from finalised roles will be returned.
- Return type:
Sequence[Self]
- class models.volunteer.shift.ShiftEntry(**kwargs)[source]
Join table used to indicate a volunteer has signed up for a given shift.
- state: Mapped[ShiftEntryState][source]
Indicates whether a volunteer has arrived for/completed a shift.
- eligible_for_checkin_at(now)[source]
Checks if we can transition to ARRIVED and the shift starts in 15 minutes or less from now.
- Return type:
bool