MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / register_attribute

Function register_attribute

lib/sqlalchemy/orm/attributes.py:2579–2592  ·  view source on GitHub ↗
(
    class_: Type[_O],
    key: str,
    *,
    comparator: interfaces.PropComparator[_T],
    parententity: _InternalEntityType[_O],
    doc: Optional[str] = None,
    **kw: Any,
)

Source from the content-addressed store, hash-verified

2577
2578
2579def register_attribute(
2580 class_: Type[_O],
2581 key: str,
2582 *,
2583 comparator: interfaces.PropComparator[_T],
2584 parententity: _InternalEntityType[_O],
2585 doc: Optional[str] = None,
2586 **kw: Any,
2587) -> InstrumentedAttribute[_T]:
2588 desc = register_descriptor(
2589 class_, key, comparator=comparator, parententity=parententity, doc=doc
2590 )
2591 register_attribute_impl(class_, key, **kw)
2592 return desc
2593
2594
2595def register_attribute_impl(

Callers

nothing calls this directly

Calls 2

register_descriptorFunction · 0.85
register_attribute_implFunction · 0.85

Tested by

no test coverage detected