org.forms.resource ================== .. py:module:: org.forms.resource Classes ------- .. autoapisummary:: org.forms.resource.ResourceBaseForm org.forms.resource.ResourceForm org.forms.resource.ResourceCleanupForm org.forms.resource.ResourceExportForm Module Contents --------------- .. py:class:: ResourceBaseForm(formdata: webob.multidict.MultiDict[str, Any] | None = None, obj: object | None = None, prefix: str = '', data: dict[str, Any] | None = None, meta: dict[str, Any] | None = None, *, extra_filters: collections.abc.Mapping[str, collections.abc.Sequence[Any]] | None = None, **kwargs: Any) Bases: :py:obj:`onegov.form.Form` Defines the form for all resources. .. py:attribute:: title .. py:attribute:: lead .. py:attribute:: group .. py:attribute:: text .. py:attribute:: pick_up .. py:attribute:: definition .. py:attribute:: deadline_unit .. py:attribute:: deadline_hours .. py:attribute:: deadline_days .. py:attribute:: zipcode_block_use .. py:attribute:: zipcode_field .. py:attribute:: zipcode_list .. py:attribute:: zipcode_days .. py:attribute:: default_view .. py:attribute:: pricing_method .. py:attribute:: price_per_item .. py:attribute:: price_per_hour .. py:attribute:: currency .. py:method:: on_request() -> None .. py:property:: zipcodes :type: list[int] .. py:method:: validate_zipcode_field(field: wtforms.fields.TextAreaField) -> None .. py:method:: validate_zipcode_list(field: wtforms.fields.TextAreaField) -> None .. py:method:: ensure_valid_price() -> bool | None .. py:property:: deadline :type: tuple[int, Literal['d', 'h']] | None .. py:property:: zipcode_block :type: dict[str, Any] | None .. py:method:: populate_obj(obj: onegov.reservation.Resource) -> None A reimplementation of wtforms populate_obj function with the addage of optional include/exclude filters. If neither exclude nor include is passed, the function works like it does in wtforms. Otherwise fields are considered which are included but not excluded. .. py:method:: process_obj(obj: onegov.reservation.Resource) -> None Called by :meth:`process` if an object was passed. Do *not* use this function directly. To process an object, you should call ``form.process(obj=obj)`` instead. .. py:class:: ResourceForm(formdata: webob.multidict.MultiDict[str, Any] | None = None, obj: object | None = None, prefix: str = '', data: dict[str, Any] | None = None, meta: dict[str, Any] | None = None, *, extra_filters: collections.abc.Mapping[str, collections.abc.Sequence[Any]] | None = None, **kwargs: Any) Bases: :py:obj:`ResourceBaseForm`, :py:obj:`onegov.org.forms.generic.PaymentForm` Defines the form for all resources. .. py:class:: ResourceCleanupForm(formdata: webob.multidict.MultiDict[str, Any] | None = None, obj: object | None = None, prefix: str = '', data: dict[str, Any] | None = None, meta: dict[str, Any] | None = None, *, extra_filters: collections.abc.Mapping[str, collections.abc.Sequence[Any]] | None = None, **kwargs: Any) Bases: :py:obj:`onegov.org.forms.generic.DateRangeForm` Defines the form to remove multiple allocations. .. py:attribute:: weekdays .. py:class:: ResourceExportForm(formdata: webob.multidict.MultiDict[str, Any] | None = None, obj: object | None = None, prefix: str = '', data: dict[str, Any] | None = None, meta: dict[str, Any] | None = None, *, extra_filters: collections.abc.Mapping[str, collections.abc.Sequence[Any]] | None = None, **kwargs: Any) Bases: :py:obj:`onegov.org.forms.generic.DateRangeForm`, :py:obj:`onegov.org.forms.generic.ExportForm` A form providing a start/end date range.