ParentLookup

class parent_lookup.lookup.ParentLookup(parent_type: type[TParent])

Bases: Generic[TParent]

Descriptor that resolves a parent instance for a child object.

The descriptor is intended for declaration on child classes to avoid repeating explicit find_parent methods. It delegates lookup resolution to lookup_registry and returns None when no parent is found.

__init__(parent_type: type[TParent]) None

Methods

__init__(parent_type)