org.pricing_schemes.stadtschulen_zug
Attributes
Classes
Defines a complex pricing scheme, that cannot be expressed using |
Module Contents
- class org.pricing_schemes.stadtschulen_zug.StadtschulenZug[source]
Bases:
onegov.reservation.ResourcePricingSchemeDefines a complex pricing scheme, that cannot be expressed using the regular available configuration knobs.
These are generally extremely specific to single customers and while they do feature parameters that can be set per resource, the formula itself is static and should not be changed after its inital creation.
If the formula needs to change we need to create a new scheme instead, so old reservations can keep relying on the old scheme.
- classmethod reservation_unit_price(reservation: onegov.reservation.Reservation, resource: onegov.reservation.Resource, submission_data: dict[str, Any] | None) decimal.Decimal | None[source]
Calculates the unit price for the given reservation.
- classmethod extend_form[T: onegov.form.Form](form_class: type[T], request: onegov.org.request.OrgRequest) type[T][source]
Extends the resource form with any fields specific to this pricing scheme.
The fields should always set depends_on=(‘pricing_scheme’, cls.name) and the field names schould be prefixed with the name of the pricing scheme, so they never conflict with the fields added by other pricing schemes.