fsi.models.course_event
Attributes
Classes
Mixin providing created/modified timestamps for all records. |
Functions
Module Contents
- fsi.models.course_event.EventStatusType: TypeAlias = Literal['created', 'confirmed', 'canceled', 'planned'][source]
- fsi.models.course_event.COURSE_EVENT_STATUSES: tuple[EventStatusType, Ellipsis] = ('created', 'confirmed', 'canceled', 'planned')[source]
- fsi.models.course_event.course_status_choices(request: FsiRequest | None = None, as_dict: Literal[False] = False) list[wtforms.fields.choices._Choice] [source]
- fsi.models.course_event.course_status_choices(request: FsiRequest | None, as_dict: Literal[True]) list[dict[str, str]]
- fsi.models.course_event.course_status_choices(request: FsiRequest | None = None, *, as_dict: Literal[True]) list[dict[str, str]]
- class fsi.models.course_event.CourseEvent[source]
Bases:
onegov.core.orm.Base
,onegov.core.orm.mixins.TimestampMixin
,onegov.search.ORMSearchable
Mixin providing created/modified timestamps for all records.
The columns are deferred loaded as this is primarily for logging and future forensics.
- es_properties[source]
Returns the type mapping of this model. Each property in the mapping will be read from the model instance.
The returned object needs to be a dict or an object that provides a
to_dict
method.Internally, onegov.search stores differing languages in different indices. It does this automatically through langauge detection, or by manually specifying a language.
Note that objects with multiple languages are not supported (each object is supposed to have exactly one language).
Onegov.search will automatically insert the right analyzer for types like these.
There’s currently only limited support for properties here, namely objects and nested mappings do not work! This is going to be added in the future though.
- property es_public: bool[source]
Returns True if the model is available to be found by the public. If false, only editors/admins will see this object in the search results.
- attendees: relationship[AppenderQuery[CourseAttendee]][source]
- subscriptions: relationship[AppenderQuery[CourseSubscription]][source]
- notification_templates: relationship[list[CourseNotificationTemplate]][source]
- info_template: relationship[InfoTemplate][source]
- reservation_template: relationship[SubscriptionTemplate][source]
- cancellation_template: relationship[CancellationTemplate][source]
- reminder_template: relationship[ReminderTemplate][source]
- property description_html: markupsafe.Markup[source]
Returns the portrait that is saved as HTML from the redactor js plugin.
- excluded_subscribers(year: int | None = None, as_uids: Literal[True] = True, exclude_inactive: bool = True) Query[tuple[uuid.UUID]] [source]
- excluded_subscribers(year: int | None, as_uids: Literal[False], exclude_inactive: bool = True) Query[CourseAttendee]
- excluded_subscribers(year: int | None = None, *, as_uids: Literal[False], exclude_inactive: bool = True) Query[CourseAttendee]
- excluded_subscribers(year: int | None, as_uids: bool, exclude_inactive: bool = True) Query[tuple[uuid.UUID]] | Query[CourseAttendee]
Returns a list of attendees / names tuple of UIDS of attendees that have booked one of the events of a course in the given year.
- possible_subscribers(external_only: bool = False, year: int | None = None, as_uids: Literal[False] = False, exclude_inactive: bool = True, auth_attendee: onegov.fsi.models.course_attendee.CourseAttendee | None = None) Query[CourseAttendee] [source]
- possible_subscribers(external_only: bool, year: int | None, as_uids: Literal[True], exclude_inactive: bool = True, auth_attendee: onegov.fsi.models.course_attendee.CourseAttendee | None = None) Query[tuple[uuid.UUID]]
- possible_subscribers(external_only: bool = False, year: int | None = None, *, as_uids: Literal[True], exclude_inactive: bool = True, auth_attendee: onegov.fsi.models.course_attendee.CourseAttendee | None = None) Query[tuple[uuid.UUID]]
Returns the list of possible bookers. Attendees that already have a subscription for the parent course in the same year are excluded.
- can_book(attendee_or_id: CourseAttendee | uuid.UUID | str, year: int | None = None) bool [source]