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[T](Protocol): def meth(self) -> T: ...
- org.forms.allocation.choices_as_integer(choices: collections.abc.Iterable[str] | None) list[int] | None[source]
- org.forms.allocation.rules_choices(form: BatchCopyAllocationRulesForm, field: onegov.form.fields.MultiCheckboxField) list[wtforms.fields.SelectChoice][source]
- org.forms.allocation.resources_choices(form: BatchCopyAllocationRulesForm, field: onegov.form.fields.MultiCheckboxField) list[wtforms.fields.SelectChoice][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, whole_day: bool = False, 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[source]
Bases:
onegov.form.FormBase form form allocation rules.
- class org.forms.allocation.AllocationForm[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 adjustable_reservation_range: bool[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[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 adjustable_reservation_range: bool[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.DaypassAllocationForm[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().
- adjustable_reservation_range = 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[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.
- adjustable_reservation_range = False[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- class org.forms.allocation.RoomAllocationForm[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 adjustable_reservation_range: 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[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().
- adjustable_reservation_range = 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[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.
- adjustable_reservation_range = False[source]
Passed to
libres.db.scheduler.Scheduler.allocate().
- class org.forms.allocation.RoomAllocationEditForm[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.
- property adjustable_reservation_range: bool[source]
Passed to
libres.db.scheduler.Scheduler.allocate().