self.active_history = active_history
self.expire_missing = expire_missing
+
def hasparent(self, state, optimistic=False):
"""Return the boolean value of a `hasparent` flag attached to
the given state.
def mapper(self):
raise exc.UnmappedClassError(self.class_)
+ def _attr_has_impl(self, key):
+ """Return True if the given attribute is fully initialized.
+
+ i.e. has an impl.
+ """
+
+ return key in self and self[key].impl is not None
+
def _configure_create_arguments(self,
_source=None,
deferred_scalar_loader=None):
manager[key].impl = impl
manager.post_configure_attribute(key)
+
def register_descriptor(class_, key, proxy_property=None, comparator=None,
parententity=None, property_=None, doc=None):
_compile_started = False
_compile_finished = False
-
+
def init(self):
"""Called after all mappers are created to assemble
relationships between mappers and perform other post-mapper-creation
``StrategizedOption`` objects via the Query.options() method.
"""
-
+
def _get_context_strategy(self, context, path):
cls = context.attributes.get(('loaderstrategy',
_reduce_path(path)), None)
self.strategy = self.__init_strategy(self.strategy_class)
def post_instrument_class(self, mapper):
- if self.is_primary():
+ if self.is_primary() and \
+ not mapper.class_manager._attr_has_impl(self.key):
self.strategy.init_class_attribute(mapper)
-
+
def build_path(entity, key, prev=None):
if prev:
return prev + (entity, key)