org.views.allocation

Attributes

AllocationForm

Functions

view_allocations_json(→ onegov.core.types.JSON_ro)

Returns the allocations in a fullcalendar compatible events feed.

process_rules(→ None)

Manually runs the rules processing cronjobs for testing.

view_allocation_rules(→ onegov.core.types.RenderData)

get_new_allocation_form_class(→ type[AllocationForm])

Returns the form class for new allocations (different resources have

get_edit_allocation_form_class(→ type[AllocationEditForm])

Returns the form class for existing allocations (different resources

get_allocation_rule_form_class(...)

Returns the form class for allocation rules.

handle_new_allocation(→ RenderData | Response)

Handles new allocations for differing form classes.

handle_edit_allocation(→ RenderData | Response)

Handles edit allocation for differing form classes.

handle_delete_allocation(→ None)

Deletes the given resource (throwing an error if there are existing

handle_allocation_rule(→ RenderData | Response)

handle_edit_rule(→ RenderData | Response)

rule_id_from_request(→ str)

Returns the rule_id from the request params, ensuring that

handle_rules_cronjob(→ None)

Handles all cronjob duties of the rules stored on the given

delete_rule(→ None)

Removes the given rule from the resource.

handle_stop_rule(→ None)

handle_delete_rule(→ None)

Module Contents

org.views.allocation.AllocationForm: TypeAlias = DaypassAllocationForm | RoomAllocationForm | DailyItemAllocationForm[source]
org.views.allocation.view_allocations_json(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) onegov.core.types.JSON_ro[source]

Returns the allocations in a fullcalendar compatible events feed.

See https://fullcalendar.io/docs/event_data/events_json_feed/ for more information.

org.views.allocation.process_rules(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) None[source]

Manually runs the rules processing cronjobs for testing.

Not really dangerous, though it should be replaced with something proper instead, cronjobs currently do not run in most tests and that should be remedied.

org.views.allocation.view_allocation_rules(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.AllocationRulesLayout | None = None) onegov.core.types.RenderData[source]
org.views.allocation.get_new_allocation_form_class(resource: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) type[AllocationForm][source]

Returns the form class for new allocations (different resources have different allocation forms).

org.views.allocation.get_edit_allocation_form_class(allocation: onegov.reservation.Allocation, request: onegov.org.request.OrgRequest) type[AllocationEditForm][source]

Returns the form class for existing allocations (different resources have different allocation forms).

org.views.allocation.get_allocation_rule_form_class(resource: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) type[onegov.org.forms.AllocationRuleForm][source]

Returns the form class for allocation rules.

org.views.allocation.handle_new_allocation(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: AllocationForm, layout: onegov.org.layout.ResourceLayout | None = None) RenderData | Response[source]

Handles new allocations for differing form classes.

org.views.allocation.handle_edit_allocation(self: onegov.reservation.Allocation, request: onegov.org.request.OrgRequest, form: AllocationEditForm, layout: onegov.org.layout.AllocationEditFormLayout | None = None) RenderData | Response[source]

Handles edit allocation for differing form classes.

org.views.allocation.handle_delete_allocation(self: onegov.reservation.Allocation, request: onegov.org.request.OrgRequest) None[source]

Deletes the given resource (throwing an error if there are existing reservations associated with it).

org.views.allocation.handle_allocation_rule(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: onegov.org.forms.AllocationRuleForm, layout: onegov.org.layout.AllocationRulesLayout | None = None) RenderData | Response[source]
org.views.allocation.handle_edit_rule(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: onegov.org.forms.AllocationRuleForm, layout: onegov.org.layout.AllocationRulesLayout | None = None) RenderData | Response[source]
org.views.allocation.rule_id_from_request(request: onegov.org.request.OrgRequest) str[source]

Returns the rule_id from the request params, ensuring that an actual uuid is returned.

org.views.allocation.handle_rules_cronjob(resource: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) None[source]

Handles all cronjob duties of the rules stored on the given resource.

org.views.allocation.delete_rule(resource: onegov.reservation.Resource, rule_id: str) None[source]

Removes the given rule from the resource.

org.views.allocation.handle_stop_rule(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) None[source]
org.views.allocation.handle_delete_rule(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) None[source]