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:
Protocol
Base 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: ...
- 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: Iterable[int] | None = None) list[tuple[datetime.datetime, datetime.datetime]] [source]
Takes the given dates and generates the date tuples.
The
except_for
field will be considered if present, as will theon_holidays
setting.
- class org.forms.allocation.AllocationRuleForm(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
Base form form allocation rules.
- class org.forms.allocation.AllocationForm(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
,AllocationFormHelpers
Baseform 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: SequenceOrScalar[tuple[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: 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
,AllocationFormHelpers
Baseform 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: 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:
AllocationForm
,Daypasses
Baseform 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: Sequence[tuple[datetime, datetime]][source]
Passed to
libres.db.scheduler.Scheduler.allocate()
.
- class org.forms.allocation.DaypassAllocationEditForm(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:
AllocationEditForm
,Daypasses
Baseform 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: 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:
AllocationForm
Baseform 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: Sequence[tuple[datetime, datetime]][source]
Passed to
libres.db.scheduler.Scheduler.allocate()
.
- class org.forms.allocation.DailyItemAllocationForm(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:
AllocationForm
,DailyItemFields
Baseform 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: Sequence[tuple[datetime, datetime]][source]
Passed to
libres.db.scheduler.Scheduler.allocate()
.
- class org.forms.allocation.DailyItemAllocationEditForm(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:
AllocationEditForm
,DailyItemFields
Baseform 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: 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:
AllocationEditForm
Baseform 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.