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

Method init_class_attribute

lib/sqlalchemy/orm/strategies.py:787–819  ·  view source on GitHub ↗
(self, mapper)

Source from the content-addressed store, hash-verified

785 )
786
787 def init_class_attribute(self, mapper):
788 self.is_class_level = True
789
790 _legacy_inactive_history_style = (
791 self.parent_property._legacy_inactive_history_style
792 )
793
794 if self.parent_property.active_history:
795 active_history = True
796 _deferred_history = False
797
798 elif (
799 self.parent_property.direction is not interfaces.MANYTOONE
800 or not self.use_get
801 ):
802 if _legacy_inactive_history_style:
803 active_history = True
804 _deferred_history = False
805 else:
806 active_history = False
807 _deferred_history = True
808 else:
809 active_history = _deferred_history = False
810
811 _register_attribute(
812 self.parent_property,
813 mapper,
814 useobject=True,
815 callable_=self._load_for_state,
816 typecallable=self.parent_property.collection_class,
817 active_history=active_history,
818 _deferred_history=_deferred_history,
819 )
820
821 def _memoized_attr__simple_lazy_clause(self):
822 lazywhere = self._lazywhere

Callers

nothing calls this directly

Calls 1

_register_attributeFunction · 0.70

Tested by

no test coverage detected