reservation.collection ====================== .. py:module:: reservation.collection Attributes ---------- .. autoapisummary:: reservation.collection._R reservation.collection.any_type_t reservation.collection.any_type Classes ------- .. autoapisummary:: reservation.collection._Marker reservation.collection.ResourceCollection Module Contents --------------- .. py:data:: _R .. py:class:: _Marker(*args, **kwds) Bases: :py:obj:`enum.Enum` Create a collection of name/value pairs. Example enumeration: >>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3 Access them by: - attribute access:: >>> Color.RED - value lookup: >>> Color(1) - name lookup: >>> Color['RED'] Enumerations can be iterated over, and know how many members they have: >>> len(Color) 3 >>> list(Color) [, , ] Methods can be added to enumerations, and members can have their own attributes -- see the documentation for details. .. py:attribute:: any_type .. py:type:: any_type_t :canonical: Literal[_Marker.any_type] .. py:data:: any_type :type: any_type_t .. py:class:: ResourceCollection(libres_context: libres.context.core.Context) Manages a list of resources. .. py:attribute:: libres_context .. py:attribute:: session .. py:method:: query() -> sqlalchemy.orm.Query[onegov.reservation.models.Resource] .. py:method:: add(title: str, timezone: str, type: str | None = None, name: str | None = None, meta: dict[str, Any] | None = None, content: dict[str, Any] | None = None, definition: str | None = None, group: str | None = None) -> onegov.reservation.models.Resource .. py:method:: bind(resource: _R) -> _R bind(resource: None) -> None .. py:method:: by_id(id: uuid.UUID, ensure_type: str | any_type_t = any_type) -> onegov.reservation.models.Resource | None .. py:method:: by_name(name: str, ensure_type: str | any_type_t = any_type) -> onegov.reservation.models.Resource | None .. py:method:: by_allocation(allocation: libres.db.models.Allocation) -> onegov.reservation.models.Resource | None .. py:method:: by_reservation(reservation: libres.db.models.Reservation) -> onegov.reservation.models.Resource | None .. py:method:: delete(resource: onegov.reservation.models.Resource, including_reservations: bool = False, handle_reservation: collections.abc.Callable[[libres.db.models.Reservation], Any] | None = None) -> None