activity.models.attendee

Module Contents

Classes

Attendee

Attendees are linked to zero to many bookings. Each booking

Attributes

P

activity.models.attendee.P[source]
class activity.models.attendee.Attendee[source]

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

Attendees are linked to zero to many bookings. Each booking has an attendee.

Though an attendee may be the same person as a username in reality, in the model we treat those subjects as separate.

property es_suggestion: str[source]

Returns suggest-as-you-type value of the document. The field used for this property should also be indexed, or the suggestion will lead to nowhere.

If a single string is returned, the completion input equals the completion output. (My Title -> My Title)

If an array of strings is returned, all values are possible inputs and the first value is the output. (My Title/Title My -> My Title)

__tablename__ = 'attendees'[source]
es_properties[source]
es_public = False[source]
id: Column[uuid.UUID][source]
username: Column[str][source]
name: Column[str][source]
birth_date: Column[date][source]
gender: Column[str | None][source]
notes: Column[str | None][source]
differing_address: Column[bool][source]
address: Column[str | None][source]
zip_code: Column[str | None][source]
place: Column[str | None][source]
political_municipality: Column[str | None][source]
limit: Column[int | None][source]
user: relationship[User][source]
subscription_token: Column[str][source]
bookings: relationship[list[Booking]][source]
__table_args__ = ()[source]
__hash__() int[source]

Return hash(self).

validate_gender(field: str, value: str | None) str | None[source]
age() int[source]
age() ColumnElement[int][source]
happiness(period_id: uuid.UUID) float | None[source]

Returns the happiness of the attende in the given period.

The happiness is a value between 0.0 and 1.0, indicating how many of the bookings on the wishlist were fulfilled.

If all bookings were fulfilled, the happiness is 1.0, if no bookings were fulfilled the hapiness is 0.0.

The priority of the bookings is taken into account. The decision on a high-priority booking has a higher impact than the decision on a low-priority booking. To model this we simply multiply the booking priority when summing up the happiness. So if a booking with priority 1 is accepted, it is as if 2 bookings were accepted. If a booking with priority 1 is denied, it is as if 2 bookings were denied.

happiness(period_id: uuid.UUID) ColumnElement[float | None][source]