org.models.resource

Module Contents

Classes

FindYourSpotCollection

Manages a list of resources.

SharedMethods

DaypassResource

A resource holds a single calendar with allocations and reservations.

RoomResource

A resource holds a single calendar with allocations and reservations.

ItemResource

A resource holds a single calendar with allocations and reservations.

class org.models.resource.FindYourSpotCollection(libres_context: libres.context.core.Context, group: str | None)[source]

Bases: onegov.reservation.ResourceCollection

Manages a list of resources.

property title: str[source]
property meta: dict[str, Any][source]
query() Query[Resource][source]
class org.models.resource.SharedMethods[source]
property deletable: bool[source]
property future_managed_reservations: Query[Reservation][source]
property future_managed_reserved_slots: Query[ReservedSlot][source]
property calendar_date_range: tuple[datetime.datetime, datetime.datetime][source]

Returns the date range set by the fullcalendar specific params.

lead: onegov.core.orm.mixins.dict_property[str | None][source]
text: onegov.core.orm.mixins.dict_property[str | None][source]
occupancy_is_visible_to_members: onegov.core.orm.mixins.dict_property[bool | None][source]
occupancy_is_visible_to_members[source]
remove_expired_reservation_sessions(expiration_date: datetime.datetime | None = None) None[source]
bound_reservations(request: onegov.org.request.OrgRequest, status: str = 'pending') Query[Reservation][source]

The reservations associated with this resource and user.

bound_session_id(request: onegov.org.request.OrgRequest) uuid.UUID[source]

The session id associated with this resource and user.

reservations_with_tickets_query(start: datetime.datetime | None = None, end: datetime.datetime | None = None, exclude_pending: bool = True) Query[Reservation][source]

Returns a query which joins this resource’s reservations between start and end with the tickets table.

reservation_title(reservation: onegov.reservation.Reservation) str[source]
class org.models.resource.DaypassResource[source]

Bases: onegov.reservation.Resource, onegov.org.models.extensions.AccessExtension, onegov.search.SearchableContent, onegov.org.models.extensions.ContactExtension, onegov.org.models.extensions.PersonLinkExtension, onegov.org.models.extensions.CoordinatesExtension, SharedMethods, onegov.org.models.extensions.ResourceValidationExtension, onegov.org.models.extensions.GeneralFileLinkExtension

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.

__mapper_args__[source]
es_type_name = 'daypasses'[source]
view = 'month'[source]
show_quota = True[source]
title_template = '{start:%d.%m.%Y} ({quota})'[source]
class org.models.resource.RoomResource[source]

Bases: onegov.reservation.Resource, onegov.org.models.extensions.AccessExtension, onegov.search.SearchableContent, onegov.org.models.extensions.ContactExtension, onegov.org.models.extensions.PersonLinkExtension, onegov.org.models.extensions.CoordinatesExtension, SharedMethods, onegov.org.models.extensions.ResourceValidationExtension, onegov.org.models.extensions.GeneralFileLinkExtension

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.

property deletable: bool[source]
__mapper_args__[source]
es_type_name = 'rooms'[source]
view[source]
show_quota = False[source]
title_template = '{start:%d.%m.%Y} {start:%H:%M} - {end:%H:%M}'[source]
class org.models.resource.ItemResource[source]

Bases: onegov.reservation.Resource, onegov.org.models.extensions.AccessExtension, onegov.search.SearchableContent, onegov.org.models.extensions.ContactExtension, onegov.org.models.extensions.PersonLinkExtension, onegov.org.models.extensions.CoordinatesExtension, SharedMethods, onegov.org.models.extensions.ResourceValidationExtension, onegov.org.models.extensions.GeneralFileLinkExtension

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.

__mapper_args__[source]
es_type_name = 'daily_items'[source]
view[source]
show_quota = True[source]
title_template = '{start:%d.%m.%Y} {start:%H:%M} - {end:%H:%M} ({quota})'[source]