fsi.models.course_attendee

Attributes

external_attendee_org

Classes

CourseAttendee

Comprises the user base mirrored by one-to-one relationship with

Module Contents

fsi.models.course_attendee.external_attendee_org = 'Externe Kursteilnehmer'[source]
class fsi.models.course_attendee.CourseAttendee[source]

Bases: onegov.core.orm.Base, onegov.search.ORMSearchable

Comprises the user base mirrored by one-to-one relationship with onegov.user.User which is linked to the LDAP System including external users, that are created by an admin role.

The onegov.user.User model should only contain email and role and is only used for authentication and permissions.

All other attributes should be stored in here.

Entries - external attendees: the do not have a link to a user - CourseAttendees linked to an admin role, aka Kursverantwortlicher - CourseAttendess linked to a member role, aka Kursbesucher

__tablename__ = 'fsi_attendees'[source]
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.

es_public = False[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.

id: Column[uuid.UUID][source]
user_id: Column[uuid.UUID | None][source]
user: relationship[User | None][source]
active: Column[bool][source]
source_id: Column[str | None][source]
first_name: Column[str | None][source]
last_name: Column[str | None][source]
organisation: Column[str | None][source]
permissions: Column[list[str] | None][source]
_email: Column[str | None][source]
__str__() str[source]
meta: Column[dict[str, Any] | None][source]
subscriptions: relationship[AppenderQuery[CourseSubscription]][source]
property title: str[source]
property lead: str | None[source]
property is_external: bool[source]
property role: str[source]
property email: str[source]

Needs a switch for external users

property course_events: Query[CourseEvent][source]
Will return the query for not completed (future) courses events

the attendee has a subscription record.

property confirmed_course_events: Query[CourseEvent][source]

Registered future course events which have been confirmed

property total_done_course_events: Query[CourseSubscription][source]
property repeating_courses: Query[CourseEvent][source]

Will return query to filter for all upcoming courses the attendee has to refresh.

This is necessary to answer: if one course, how many course events has an attendee: a) not registered if he had to or b) from the perspective of a course_event, was there a succeeding course event in the range of the refresh interval?

property undone_registered_courses: Query[CourseEvent][source]
possible_course_events(show_hidden: bool = True, show_locked: bool = False) Query[CourseEvent][source]

Used for the subscription form. Should exclude past courses and courses already registered