Bases: libres.db.models.base.ORMBase, onegov.core.orm.ModelBase, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.mixins.TimestampMixin, onegov.file.MultiAssociatedFiles
A resource holds a single calendar with allocations and reservations.
Note that this resource is not defined on the onegov.core declarative base.
Instead it is defined using the libres base. This means we can’t join
data outside the libres models.
This should however not be a problem as this onegov module is self
contained and does not link to other onegov modules, except for core.
If we ever want to link to other models (say link a reservation to a user),
then we have to switch to a unified base. Ideally we would find a way
to merge these bases somehow.
Also note that we do use the ModelBase class as a mixin to at least share
the same methods as all the usual onegov.core.orm models.
-
__tablename__ = 'resources'[source]
-
id: sqlalchemy.Column[uuid.UUID][source]
-
name: sqlalchemy.Column[str | None][source]
-
title: sqlalchemy.Column[str][source]
-
timezone: sqlalchemy.Column[str][source]
-
definition: sqlalchemy.Column[str | None][source]
-
group: sqlalchemy.Column[str | None][source]
-
subgroup: sqlalchemy.Column[str | None][source]
-
type: sqlalchemy.Column[str][source]
-
payment_method: onegov.core.orm.mixins.dict_property[onegov.pay.types.PaymentMethod | None][source]
-
minimum_price_total: onegov.core.orm.mixins.dict_property[float | None][source]
-
currency: onegov.core.orm.mixins.dict_property[str | None][source]
-
pricing_method: onegov.core.orm.mixins.dict_property[str | None][source]
-
price_per_hour: onegov.core.orm.mixins.dict_property[float | None][source]
-
price_per_item: onegov.core.orm.mixins.dict_property[float | None][source]
-
invoicing_party: onegov.core.orm.mixins.dict_property[str | None][source]
-
cost_object: onegov.core.orm.mixins.dict_property[str | None][source]
-
ical_fields: onegov.core.orm.mixins.dict_property[list[str]][source]
-
deadline: onegov.core.orm.mixins.dict_property[tuple[int, DeadlineUnit] | None][source]
-
lead_time: onegov.core.orm.mixins.dict_property[int | None][source]
-
default_view: onegov.core.orm.mixins.dict_property[str | None][source]
-
zipcode_block: onegov.core.orm.mixins.dict_property[dict[str, Any] | None][source]
-
access_token: onegov.core.orm.mixins.dict_property[str | None][source]
-
pick_up: onegov.core.orm.mixins.dict_property[str | None][source]
-
reply_to: onegov.core.orm.mixins.dict_property[str | None][source]
-
__mapper_args__[source]
-
allocations: sqlalchemy.orm.relationship[list[libres.db.models.Allocation]][source]
-
date: datetime.date | None = None[source]
-
highlights_min: int | None = None[source]
-
highlights_max: int | None = None[source]
-
view: str | None = 'dayGridMonth'[source]
-
highlight_allocations(allocations: collections.abc.Sequence[libres.db.models.Allocation]) → None[source]
The allocation to jump to in the view.
-
get_scheduler(libres_context: libres.context.core.Context) → _OurScheduler[source]
-
property scheduler: _OurScheduler[source]
-
bind_to_libres_context(libres_context: libres.context.core.Context) → None[source]
-
property form_class: type[onegov.form.Form] | None[source]
Parses the form definition and returns a form class.
-
invoice_items_for_reservation(reservations: collections.abc.Sequence[onegov.reservation.models.CustomReservation], extras: collections.abc.Sequence[onegov.pay.InvoiceItemMeta] | None = None, discounts: collections.abc.Sequence[onegov.pay.InvoiceDiscountMeta] | None = None, *, reduced_amount_label: str) → list[onegov.pay.InvoiceItemMeta][source]
-
process_payment(price: onegov.pay.Price | None, provider: onegov.pay.PaymentProvider[Any] | None = None, payment_token: str | None = None) → onegov.pay.Payment | onegov.pay.PaymentError | Literal[True] | None[source]
Processes the payment for the given reservation token.
-
is_before_lead_time(dt: datetime.datetime) → bool[source]
-
is_past_deadline(dt: datetime.datetime) → bool[source]
-
is_zip_blocked(date: datetime.date) → bool[source]
-
is_allowed_zip_code(zipcode: int) → bool[source]
-
renew_access_token() → None[source]
-
__repr__() → str[source]