org.views.allocation ==================== .. py:module:: org.views.allocation Attributes ---------- .. autoapisummary:: org.views.allocation.AllocationForm Functions --------- .. autoapisummary:: org.views.allocation.view_allocations_json org.views.allocation.process_rules org.views.allocation.view_allocation_rules org.views.allocation.get_new_allocation_form_class org.views.allocation.get_edit_allocation_form_class org.views.allocation.get_allocation_rule_form_class org.views.allocation.handle_new_allocation org.views.allocation.handle_edit_allocation org.views.allocation.handle_delete_allocation org.views.allocation.handle_allocation_rule org.views.allocation.handle_edit_rule org.views.allocation.rule_id_from_request org.views.allocation.handle_rules_cronjob org.views.allocation.delete_rule org.views.allocation.handle_stop_rule org.views.allocation.handle_delete_rule Module Contents --------------- .. py:type:: AllocationForm :canonical: DaypassAllocationForm | RoomAllocationForm | DailyItemAllocationForm .. py:function:: view_allocations_json(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> onegov.core.types.JSON_ro Returns the allocations in a fullcalendar compatible events feed. See ``_ for more information. .. py:function:: process_rules(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> None 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. .. py:function:: view_allocation_rules(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, layout: onegov.org.layout.AllocationRulesLayout | None = None) -> onegov.core.types.RenderData .. py:function:: get_new_allocation_form_class(resource: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> type[AllocationForm] Returns the form class for new allocations (different resources have different allocation forms). .. py:function:: get_edit_allocation_form_class(allocation: onegov.reservation.Allocation, request: onegov.org.request.OrgRequest) -> type[AllocationEditForm] Returns the form class for existing allocations (different resources have different allocation forms). .. py:function:: get_allocation_rule_form_class(resource: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> type[onegov.org.forms.AllocationRuleForm] Returns the form class for allocation rules. .. py:function:: handle_new_allocation(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: AllocationForm, layout: onegov.org.layout.ResourceLayout | None = None) -> onegov.core.types.RenderData | webob.Response Handles new allocations for differing form classes. .. py:function:: handle_edit_allocation(self: onegov.reservation.Allocation, request: onegov.org.request.OrgRequest, form: AllocationEditForm, layout: onegov.org.layout.AllocationEditFormLayout | None = None) -> onegov.core.types.RenderData | webob.Response Handles edit allocation for differing form classes. .. py:function:: handle_delete_allocation(self: onegov.reservation.Allocation, request: onegov.org.request.OrgRequest) -> None Deletes the given resource (throwing an error if there are existing reservations associated with it). .. py:function:: handle_allocation_rule(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: onegov.org.forms.AllocationRuleForm, layout: onegov.org.layout.AllocationRulesLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: handle_edit_rule(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest, form: onegov.org.forms.AllocationRuleForm, layout: onegov.org.layout.AllocationRulesLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: rule_id_from_request(request: onegov.org.request.OrgRequest) -> str Returns the rule_id from the request params, ensuring that an actual uuid is returned. .. py:function:: handle_rules_cronjob(resource: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> None Handles all cronjob duties of the rules stored on the given resource. .. py:function:: delete_rule(resource: onegov.reservation.Resource, rule_id: str) -> None Removes the given rule from the resource. .. py:function:: handle_stop_rule(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> None .. py:function:: handle_delete_rule(self: onegov.reservation.Resource, request: onegov.org.request.OrgRequest) -> None