feriennet.models.volunteer_cart
Classes
Built-in immutable sequence. |
|
Stores items of the volunteer cart view in the browser session. |
|
Represents a single action for the VolunteerCart. |
Module Contents
- class feriennet.models.volunteer_cart.CardItemRow[source]
Bases:
NamedTupleBuilt-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.
If the argument is a tuple, the return value is the same object.
- class feriennet.models.volunteer_cart.VolunteerCart(request: onegov.feriennet.request.FeriennetRequest)[source]
Stores items of the volunteer cart view in the browser session.
Items stored this way may not overlap with existing items. We want to prevent volunteers from signing up for conflicting items.
- eligible(need_ids: collections.abc.Collection[uuid.UUID]) set[uuid.UUID][source]
Returns the given needs open for signups by the current user, following the same rules as the public volunteer listing.
- card_items(need_id: uuid.UUID | None = None) collections.abc.Iterable[CardItemRow][source]
- class feriennet.models.volunteer_cart.VolunteerCartAction(action: Literal['add', 'remove'], target: uuid.UUID)[source]
Represents a single action for the VolunteerCart.
- execute(request: onegov.feriennet.request.FeriennetRequest, cart: VolunteerCart) onegov.core.types.JSON_ro[source]