activity.models.attendee
Classes
Attendees are linked to zero to many bookings. Each booking |
Module Contents
- class activity.models.attendee.Attendee[source]
Bases:
onegov.core.orm.Base,onegov.core.orm.mixins.TimestampMixin,onegov.search.ORMSearchableAttendees 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.
- 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.