org.views.resource

Attributes

T

RESOURCE_TYPES

Classes

OccupancyEntry

Functions

combine_grouped(→ dict[KT, list[T | ExternalLink]])

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(→ RenderData | BaseResponse)

handle_new_daypass(→ RenderData | BaseResponse)

handle_new_resource_item(→ RenderData | BaseResponse)

handle_new_resource(→ RenderData | BaseResponse)

handle_edit_resource(→ RenderData | BaseResponse)

view_resource(→ onegov.core.types.RenderData)

handle_delete_resource(→ None)

handle_cleanup_allocations(→ RenderData | BaseResponse)

Removes all unused allocations between the given dates.

predict_next_reservation(→ RenderData | None)

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(→ RenderData | BaseResponse)

view_export_all(→ RenderData | BaseResponse)

run_export(→ tuple[Callable[[str], tuple[int, 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: Callable[[T | ExternalLink], SupportsRichComparison] | None = None) dict[KT, list[T | 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) RenderData | BaseResponse[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) RenderData | BaseResponse[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) RenderData | BaseResponse[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) RenderData | BaseResponse[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) RenderData | BaseResponse[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) RenderData | BaseResponse[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: Iterable[BaseReservation]) 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: 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) RenderData | BaseResponse[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) RenderData | BaseResponse[source]
org.views.resource.run_export(resource: onegov.reservation.Resource, start: sedate.types.DateLike, end: sedate.types.DateLike, nested: bool, formatter: Callable[[Any], object]) tuple[Callable[[str], tuple[int, str]], list[dict[str, Any]]][source]