betty.attrs.owner module

Attributes that store data in owner instance attributes.

final class betty.attrs.owner.CollectionOwnerAttr

Bases: _Owner, Generic

An object attribute that stores its collection of data on owner instances.

get(owner: OwnerT, /) GetT

Get the property value from the owner.

init_owner(owner: OwnerT, /) None

Initialize the property on an owner.

normalize(owner: OwnerT, value: SetT, /) GetT

Normalize a value from SetT to GetT.

set(owner: OwnerT, value: SetT, /) None

Set the property value on the owner.

Raises:

NotSettable

final class betty.attrs.owner.OwnerAttr

Bases: _Owner, Generic

An object attribute that stores its data on owner instances.

final get(owner: OwnerT, /) T

Get the property value from the owner.

set(owner: OwnerT, value: T, /) None

Set the property value on the owner.

Raises:

NotSettable