feriennet.models.volunteer_cart

Classes

CardItemRow

VolunteerCart

Stores items of the volunteer cart view in the browser session.

VolunteerCartAction

Represents a single action for the VolunteerCart.

Module Contents

class feriennet.models.volunteer_cart.CardItemRow[source]

Bases: NamedTuple

need_id: uuid.UUID[source]
need_name: str[source]
start: datetime.datetime[source]
end: datetime.datetime[source]
timezone: str[source]
activity_title: str[source]
occasion_id: uuid.UUID[source]
class feriennet.models.volunteer_cart.VolunteerCart(session: sqlalchemy.orm.Session, browser_session: onegov.core.browser_session.BrowserSession)[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.

session[source]
browser_session[source]
classmethod from_request(request: onegov.feriennet.request.FeriennetRequest) Self[source]
add(need_id: uuid.UUID) None[source]
remove(need_id: uuid.UUID) None[source]
has(need_id: uuid.UUID) bool[source]
ids() Sequence[UUID][source]
clear() None[source]
card_items(need_id: UUID | None = None) Query[CardItemRow][source]
overlaps(need_id: uuid.UUID) bool[source]
for_frontend(layout: onegov.feriennet.layout.DefaultLayout, localize: bool = True) Iterator[RenderData][source]
class feriennet.models.volunteer_cart.VolunteerCartAction(action: Literal['add', 'remove'], target: uuid.UUID)[source]

Represents a single action for the VolunteerCart.

action[source]
target[source]
execute(request: onegov.feriennet.request.FeriennetRequest, cart: VolunteerCart) onegov.core.types.JSON_ro[source]