org.views.resource

Attributes

T

RESOURCE_TYPES

Classes

OccupancyEntry

Functions

combine_grouped(→ dict[KT, ...)

get_daypass_form(→ type[onegov.org.forms.ResourceForm])

get_room_form(→ type[onegov.org.forms.ResourceForm])

get_item_form(→ type[onegov.org.forms.ResourceForm])

get_resource_form(...)

view_resources(→ onegov.core.types.RenderData)

view_find_your_spot(→ onegov.core.types.RenderData)

get_find_your_spot_reservations(...)

view_resources_json(→ onegov.core.types.JSON_ro)

handle_new_room(...)

handle_new_daypass(...)

handle_new_resource_item(...)

handle_new_resource(...)

handle_edit_resource(...)

view_resource(→ onegov.core.types.RenderData)

handle_delete_resource(→ None)

handle_cleanup_allocations(...)

Removes all unused allocations between the given dates.

predict_next_reservation(...)

get_reservations(→ onegov.core.types.RenderData)

get_date(→ datetime.datetime)

get_date_range(→ tuple[datetime.datetime, ...)

view_occupancy(→ onegov.core.types.RenderData)

view_resource_subscribe(→ onegov.core.types.RenderData)

view_ical(→ morepath.request.Response)

view_export(...)

view_export_all(...)

run_export(→ tuple[collections.abc.Callable[[str], ...)

Module Contents

org.views.resource.T[source]
class org.views.resource.OccupancyEntry[source]

Bases: NamedTuple

start: datetime.datetime[source]
end: datetime.datetime[source]
title: str | None[source]
quota: int[source]
pending: bool[source]
url: str[source]
org.views.resource.RESOURCE_TYPES: dict[str, ResourceDict][source]
org.views.resource.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]][source]
org.views.resource.get_daypass_form(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest) type[onegov.org.forms.ResourceForm][source]
org.views.resource.get_room_form(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest) type[onegov.org.forms.ResourceForm][source]
org.views.resource.get_item_form(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest) type[onegov.org.forms.ResourceForm][source]
org.views.resource.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][source]
org.views.resource.view_resources(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.ResourcesLayout | None = None) onegov.core.types.RenderData[source]
org.views.resource.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[source]
org.views.resource.get_find_your_spot_reservations(self: onegov.org.models.resource.FindYourSpotCollection, request: onegov.org.request.OrgRequest) onegov.core.types.JSON_ro[source]
org.views.resource.view_resources_json(self: onegov.reservation.ResourceCollection, request: onegov.org.request.OrgRequest) onegov.core.types.JSON_ro[source]
org.views.resource.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[source]
org.views.resource.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[source]
org.views.resource.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[source]
org.views.resource.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[source]
org.views.resource.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[source]
org.views.resource.view_resource(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.ResourceLayout | None = None) onegov.core.types.RenderData[source]
org.views.resource.handle_delete_resource(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) None[source]
org.views.resource.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[source]

Removes all unused allocations between the given dates.

org.views.resource.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[source]
org.views.resource.get_reservations(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) onegov.core.types.RenderData[source]
org.views.resource.get_date(text: object, default: datetime.datetime) datetime.datetime[source]
org.views.resource.get_date_range(resource: onegov.reservation.Resource, params: collections.abc.Mapping[str, Any]) tuple[datetime.datetime, datetime.datetime][source]
org.views.resource.view_occupancy(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.ResourceLayout | None = None) onegov.core.types.RenderData[source]
org.views.resource.view_resource_subscribe(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.ResourceLayout | None = None) onegov.core.types.RenderData[source]
org.views.resource.view_ical(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) morepath.request.Response[source]
org.views.resource.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[source]
org.views.resource.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[source]
org.views.resource.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]]][source]