agency.models.mutation

Attributes

_M

_IdT_contra

_NOT_FOUND

AGENCY_MUTATION_LABELS

Classes

Mutation

Abstract base class for generic types.

AgencyMutation

Abstract base class for generic types.

PersonMutation

Abstract base class for generic types.

Module Contents

agency.models.mutation._M[source]
agency.models.mutation._IdT_contra[source]
agency.models.mutation._NOT_FOUND[source]
agency.models.mutation.AGENCY_MUTATION_LABELS[source]
class agency.models.mutation.Mutation(session: sqlalchemy.orm.Session, target_id: _IdT_contra, ticket_id: uuid.UUID)[source]

Bases: Generic[_M, _IdT_contra]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
session[source]
target_id[source]
ticket_id[source]
property collection: SupportsById[_M, _IdT_contra][source]
Abstractmethod:

property target: _M | None[source]
property ticket: Ticket | None[source]
property changes: dict[str, Any][source]
property labels: dict[str, str][source]
apply(items: Iterable[str]) None[source]
class agency.models.mutation.AgencyMutation(session: sqlalchemy.orm.Session, target_id: _IdT_contra, ticket_id: uuid.UUID)[source]

Bases: Mutation[agency.models.agency.ExtendedAgency, int]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
property collection: onegov.agency.collections.ExtendedAgencyCollection[source]
property labels: dict[str, str][source]
class agency.models.mutation.PersonMutation(session: sqlalchemy.orm.Session, target_id: _IdT_contra, ticket_id: uuid.UUID)[source]

Bases: Mutation[agency.models.person.ExtendedPerson, uuid.UUID]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
property collection: onegov.agency.collections.ExtendedPersonCollection[source]
property labels: dict[str, str][source]