org.views.resource ================== .. py:module:: org.views.resource Attributes ---------- .. autoapisummary:: org.views.resource.T org.views.resource.RESOURCE_TYPES Classes ------- .. autoapisummary:: org.views.resource.OccupancyEntry Functions --------- .. autoapisummary:: org.views.resource.combine_grouped org.views.resource.get_daypass_form org.views.resource.get_room_form org.views.resource.get_item_form org.views.resource.get_resource_form org.views.resource.view_resources org.views.resource.view_find_your_spot org.views.resource.get_find_your_spot_reservations org.views.resource.view_resources_json org.views.resource.handle_new_room org.views.resource.handle_new_daypass org.views.resource.handle_new_resource_item org.views.resource.handle_new_resource org.views.resource.handle_edit_resource org.views.resource.view_resource org.views.resource.handle_delete_resource org.views.resource.handle_cleanup_allocations org.views.resource.predict_next_reservation org.views.resource.get_reservations org.views.resource.get_date org.views.resource.get_date_range org.views.resource.view_occupancy org.views.resource.view_resource_subscribe org.views.resource.view_ical org.views.resource.view_export org.views.resource.view_export_all org.views.resource.run_export Module Contents --------------- .. py:data:: T .. py:class:: OccupancyEntry Bases: :py:obj:`NamedTuple` .. py:attribute:: start :type: datetime.datetime .. py:attribute:: end :type: datetime.datetime .. py:attribute:: title :type: str | None .. py:attribute:: quota :type: int .. py:attribute:: pending :type: bool .. py:attribute:: url :type: str .. py:data:: RESOURCE_TYPES :type: dict[str, ResourceDict] .. py:function:: combine_grouped(items: dict[KT, list[T]], external_links: dict[KT, list[onegov.org.models.external_link.ExternalLink]], sort: collections.abc.Callable[[T | onegov.org.models.external_link.ExternalLink], _typeshed.SupportsRichComparison] | None = None) -> dict[KT, list[T | onegov.org.models.external_link.ExternalLink]] .. py:function:: get_daypass_form(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest) -> type[onegov.org.forms.ResourceForm] .. py:function:: get_room_form(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest) -> type[onegov.org.forms.ResourceForm] .. py:function:: get_item_form(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest) -> type[onegov.org.forms.ResourceForm] .. py:function:: get_resource_form(self: onegov.reservation.ResourceCollection | onegov.org.models.resource.DaypassResource | onegov.org.models.resource.RoomResource | onegov.org.models.resource.ItemResource, request: onegov.org.request.OrgRequest, type: str | None = None) -> get_resource_form.type[onegov.org.forms.ResourceForm] .. py:function:: view_resources(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.ResourcesLayout | None = None) -> onegov.core.types.RenderData .. py:function:: view_find_your_spot(self: onegov.org.models.resource.FindYourSpotCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.FindYourSpotForm, layout: onegov.org.layout.FindYourSpotLayout | None = None) -> onegov.core.types.RenderData .. py:function:: get_find_your_spot_reservations(self: onegov.org.models.resource.FindYourSpotCollection, request: onegov.org.request.OrgRequest) -> onegov.core.types.JSON_ro .. py:function:: view_resources_json(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest) -> onegov.core.types.JSON_ro .. py:function:: handle_new_room(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.ResourceForm, layout: onegov.org.layout.ResourcesLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: handle_new_daypass(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.ResourceForm, layout: onegov.org.layout.ResourcesLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: handle_new_resource_item(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.ResourceForm, layout: onegov.org.layout.ResourcesLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: handle_new_resource(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.ResourceForm, type: str, layout: onegov.org.layout.ResourcesLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: handle_edit_resource(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: onegov.org.forms.ResourceForm, layout: onegov.org.layout.ResourceLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: view_resource(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.ResourceLayout | None = None) -> onegov.core.types.RenderData .. py:function:: handle_delete_resource(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> None .. py:function:: handle_cleanup_allocations(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: onegov.org.forms.ResourceCleanupForm, layout: onegov.org.layout.ResourceLayout | None = None) -> onegov.core.types.RenderData | webob.Response Removes all unused allocations between the given dates. .. py:function:: predict_next_reservation(resource: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, reservations: collections.abc.Iterable[libres.db.models.Reservation]) -> onegov.core.types.RenderData | None .. py:function:: get_reservations(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> onegov.core.types.RenderData .. py:function:: get_date(text: object, default: datetime.datetime) -> datetime.datetime .. py:function:: get_date_range(resource: onegov.reservation.Resource, params: collections.abc.Mapping[str, Any]) -> tuple[datetime.datetime, datetime.datetime] .. py:function:: view_occupancy(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.ResourceLayout | None = None) -> onegov.core.types.RenderData .. py:function:: view_resource_subscribe(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.ResourceLayout | None = None) -> onegov.core.types.RenderData .. py:function:: view_ical(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> morepath.request.Response .. py:function:: view_export(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: onegov.org.forms.ResourceExportForm, layout: onegov.org.layout.ResourceLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: view_export_all(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.resource.AllResourcesExportForm, layout: onegov.org.layout.ResourceLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: run_export(resource: onegov.reservation.Resource, start: sedate.types.DateLike, end: sedate.types.DateLike, nested: bool, formatter: collections.abc.Callable[[Any], object]) -> tuple[collections.abc.Callable[[str], tuple[int, str]], list[dict[str, Any]]]