org.forms.allocation
Classes
Base class for protocol classes. |
|
Base form form allocation rules. |
|
Baseform for all allocation forms. Allocation forms are expected |
|
Baseform for edit forms. Edit forms differ from the base allocation |
|
Baseform for all allocation forms. Allocation forms are expected |
|
Baseform for edit forms. Edit forms differ from the base allocation |
|
Baseform for all allocation forms. Allocation forms are expected |
|
Baseform for all allocation forms. Allocation forms are expected |
|
Baseform for edit forms. Edit forms differ from the base allocation |
|
Baseform for edit forms. Edit forms differ from the base allocation |
Functions
|
Module Contents
- class org.forms.allocation.DateContainer[source]
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- org.forms.allocation.choices_as_integer(choices: collections.abc.Iterable[str] | None) list[int] | None[source]
- class org.forms.allocation.AllocationFormHelpers[source]
- generate_dates(start: datetime.date | None, end: datetime.date | None, start_time: datetime.time | None = None, end_time: datetime.time | None = None, weekdays: collections.abc.Iterable[int] | None = None) list[tuple[datetime.datetime, datetime.datetime]][source]
Takes the given dates and generates the date tuples.
The
except_forfield will be considered if present, as will theon_holidayssetting.
- class org.forms.allocation.AllocationRuleForm(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)[source]
Bases:
onegov.form.FormBase form form allocation rules.
- class org.forms.allocation.AllocationForm(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)[source]
Bases:
onegov.form.Form,AllocationFormHelpersBaseform for all allocation forms. Allocation forms are expected to implement the methods above (which contain a NotImplementedException).
Have a look at
libres.db.scheduler.Scheduler.allocate()to find out more about those values.- property exceptions: DateContainer[source]
- property dates: onegov.core.types.SequenceOrScalar[tuple[datetime.datetime, datetime.datetime]][source]
- Abstractmethod:
Passed to
libres.db.scheduler.Scheduler.allocate().
- property whole_day: bool[source]
- Abstractmethod:
Passed to
libres.db.scheduler.Scheduler.allocate().
- property partly_available: bool[source]
- Abstractmethod:
Passed to
libres.db.scheduler.Scheduler.allocate().
- property quota: int[source]
- Abstractmethod:
Passed to
libres.db.scheduler.Scheduler.allocate().
- property quota_limit: int[source]
- Abstractmethod:
Passed to
libres.db.scheduler.Scheduler.allocate().
- property data: dict[str, Any][source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- class org.forms.allocation.AllocationEditForm(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)[source]
Bases:
onegov.form.Form,AllocationFormHelpersBaseform for edit forms. Edit forms differ from the base allocation form somewhat, since they don’t offer a way to generate more than one allocation at a time.
The dates property is therefore expected to return a single start, end dates tuple.
- property data: dict[str, Any][source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- class org.forms.allocation.DaypassAllocationForm(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)[source]
Bases:
AllocationForm,DaypassesBaseform for all allocation forms. Allocation forms are expected to implement the methods above (which contain a NotImplementedException).
Have a look at
libres.db.scheduler.Scheduler.allocate()to find out more about those values.- whole_day = True[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- partly_available = False[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property quota: int[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property quota_limit: int[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property dates: collections.abc.Sequence[tuple[datetime.datetime, datetime.datetime]][source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- class org.forms.allocation.DaypassAllocationEditForm(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)[source]
Bases:
AllocationEditForm,DaypassesBaseform for edit forms. Edit forms differ from the base allocation form somewhat, since they don’t offer a way to generate more than one allocation at a time.
The dates property is therefore expected to return a single start, end dates tuple.
- class org.forms.allocation.RoomAllocationForm(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)[source]
Bases:
AllocationFormBaseform for all allocation forms. Allocation forms are expected to implement the methods above (which contain a NotImplementedException).
Have a look at
libres.db.scheduler.Scheduler.allocate()to find out more about those values.- quota_limit = 1[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property quota: int[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property whole_day: bool[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property partly_available: bool[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property dates: collections.abc.Sequence[tuple[datetime.datetime, datetime.datetime]][source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- class org.forms.allocation.DailyItemAllocationForm(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)[source]
Bases:
AllocationForm,DailyItemFieldsBaseform for all allocation forms. Allocation forms are expected to implement the methods above (which contain a NotImplementedException).
Have a look at
libres.db.scheduler.Scheduler.allocate()to find out more about those values.- whole_day = True[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- partly_available = False[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property quota: int[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property quota_limit: int[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- property dates: collections.abc.Sequence[tuple[datetime.datetime, datetime.datetime]][source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- class org.forms.allocation.DailyItemAllocationEditForm(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)[source]
Bases:
AllocationEditForm,DailyItemFieldsBaseform for edit forms. Edit forms differ from the base allocation form somewhat, since they don’t offer a way to generate more than one allocation at a time.
The dates property is therefore expected to return a single start, end dates tuple.
- class org.forms.allocation.RoomAllocationEditForm(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)[source]
Bases:
AllocationEditFormBaseform for edit forms. Edit forms differ from the base allocation form somewhat, since they don’t offer a way to generate more than one allocation at a time.
The dates property is therefore expected to return a single start, end dates tuple.