org.forms.resource

Classes

ResourceBaseForm

Defines the form for all resources.

ResourceForm

Defines the form for all resources.

ResourceCleanupForm

Defines the form to remove multiple allocations.

ResourceExportForm

A form providing a start/end date range.

Module Contents

class org.forms.resource.ResourceBaseForm(formdata: 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: Mapping[str, Sequence[Any]] | None = None, **kwargs: Any)[source]

Bases: onegov.form.Form

Defines the form for all resources.

title[source]
lead[source]
group[source]
text[source]
pick_up[source]
definition[source]
deadline_unit[source]
deadline_hours[source]
deadline_days[source]
zipcode_block_use[source]
zipcode_field[source]
zipcode_list[source]
zipcode_days[source]
default_view[source]
pricing_method[source]
price_per_item[source]
price_per_hour[source]
currency[source]
on_request() None[source]
property zipcodes: list[int][source]
validate_zipcode_field(field: wtforms.fields.TextAreaField) None[source]
validate_zipcode_list(field: wtforms.fields.TextAreaField) None[source]
ensure_valid_price() bool | None[source]
property deadline: tuple[int, Literal['d', 'h']] | None[source]
property zipcode_block: dict[str, Any] | None[source]
populate_obj(obj: onegov.reservation.Resource) None[source]

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.

process_obj(obj: onegov.reservation.Resource) None[source]

Called by process() if an object was passed.

Do not use this function directly. To process an object, you should call form.process(obj=obj) instead.

class org.forms.resource.ResourceForm(formdata: 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: Mapping[str, Sequence[Any]] | None = None, **kwargs: Any)[source]

Bases: ResourceBaseForm, onegov.org.forms.generic.PaymentForm

Defines the form for all resources.

class org.forms.resource.ResourceCleanupForm(formdata: 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: Mapping[str, Sequence[Any]] | None = None, **kwargs: Any)[source]

Bases: onegov.org.forms.generic.DateRangeForm

Defines the form to remove multiple allocations.

weekdays[source]
class org.forms.resource.ResourceExportForm(formdata: 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: Mapping[str, Sequence[Any]] | None = None, **kwargs: Any)[source]

Bases: onegov.org.forms.generic.DateRangeForm, onegov.org.forms.generic.ExportForm

A form providing a start/end date range.