activity.models.attendee

Attributes

P

Classes

Attendee

Attendees are linked to zero to many bookings. Each booking

Module Contents

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.

__tablename__ = '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.

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)

__hash__() int[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]
validate_gender(field: str, value: str | None) str | None[source]
age: sqlalchemy.Column[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.

bookings: relationship[list[Booking]][source]
__table_args__[source]