people.collections.memberships

Module Contents

Classes

AgencyMembershipCollection

Manages a list of agency memberships.

class people.collections.memberships.AgencyMembershipCollection(session: sqlalchemy.orm.Session, **kwargs: Any)[source]

Bases: onegov.core.collection.GenericCollection[onegov.people.models.AgencyMembership]

Manages a list of agency memberships.

Use it like this:

from onegov.people import AgencyMembershipCollection
memberships = AgencyMembershipCollection(session)
property model_class: type[onegov.people.models.AgencyMembership][source]
by_id(id: uuid.UUID) onegov.people.models.AgencyMembership | None[source]
query(order_by: str | None = None) Query[AgencyMembership][source]
move(subject: onegov.people.models.AgencyMembership, target: onegov.people.models.AgencyMembership, direction: onegov.core.orm.abstract.MoveDirection, move_on_col: Literal[order_within_person, order_within_agency]) None[source]

Takes the given subject and moves it somewhere in relation to the target.

Subject:

The item to be moved.

Target:

The item above which or below which the subject is moved.

Direction:

The direction relative to the target. Either MoveDirection.above if the subject should be moved above the target, or MoveDirection.below if the subject should be moved below the target.

Move_on_col:

Designates the column for which the new order should be evaluated. Possible values are order_within_agency and order_within_person.