activity.models.occasion
Classes
Describes a single occurrence of an Activity. "Occurence" would have |
Module Contents
- class activity.models.occasion.Occasion[source]
Bases:
onegov.core.orm.Base
,onegov.core.orm.mixins.TimestampMixin
Describes a single occurrence of an Activity. “Occurence” would have been a good word for it too, but that’s used by onegov.event.
So occasion it is.
- age: Column[BoundedIntegerRange][source]
- spots: Column[BoundedIntegerRange][source]
- dates: relationship[list[OccasionDate]][source]
- needs: relationship[list[OccasionNeed]][source]
- on_date_change() None [source]
Date changes are not properly propagated to the observer for some reason, so we do this manually with a hook.
It’s a bit of a hack, but multiple dates per occasion had to be added at the last minute..
- property anti_affinity_group: tuple[str, str][source]
Uses the activity_id/period_id as an anti-affinity group to ensure that an attendee is never given two occasions of the same activity in a single period.
If that is wanted, the attendee is meant to do this after the matching has been done, with a direct booking.
- compute_duration(dates: Collection[OccasionDate] | None) int [source]
- compute_order(dates: Collection[OccasionDate] | None) int [source]
- compute_active_days(dates: Collection[OccasionDate] | None) list[int] [source]
- compute_weekdays(dates: Collection[OccasionDate] | None) list[int] [source]
- observe_dates(dates: Collection[OccasionDate] | None) None [source]
- validate_dates(key: str, date: activity.models.occasion_date.OccasionDate) activity.models.occasion_date.OccasionDate [source]
- observe_needs(needs: Collection[OccasionNeed] | None) None [source]
- property deadline: datetime.date[source]
The date until which this occasion may be booked (inclusive).