"committed" state, i.e. state that is understood to have
been loaded from the database. Helps with the creation of
homegrown collection loaders and such.
+
+ - Declarative figures out joined-table inheritance primary join
+ condition even if "inherits" mapper argument is given
+ explicitly. Allows mixins to be used with joined table
+ inheritance.
- sql
- Fixed missing _label attribute on Function object, others
inherits = cls._decl_class_registry.get(inherits.__name__, None)
if inherits:
mapper_args['inherits'] = inherits
- if not mapper_args.get('concrete', False) and table and 'inherit_condition' not in mapper_args:
- # figure out the inherit condition with relaxed rules
- # about nonexistent tables, to allow for ForeignKeys to
- # not-yet-defined tables (since we know for sure that our
- # parent table is defined within the same MetaData)
- mapper_args['inherit_condition'] = sql_util.join_condition(
- inherits.__table__, table,
- ignore_nonexistent_tables=True)
if hasattr(cls, '__mapper_cls__'):
mapper_cls = util.unbound_method_to_callable(cls.__mapper_cls__)
elif 'inherits' in mapper_args and not mapper_args.get('concrete', False):
inherited_mapper = class_mapper(mapper_args['inherits'], compile=False)
inherited_table = inherited_mapper.local_table
+ if 'inherit_condition' not in mapper_args and table:
+ # figure out the inherit condition with relaxed rules
+ # about nonexistent tables, to allow for ForeignKeys to
+ # not-yet-defined tables (since we know for sure that our
+ # parent table is defined within the same MetaData)
+ mapper_args['inherit_condition'] = sql_util.join_condition(
+ mapper_args['inherits'].__table__, table,
+ ignore_nonexistent_tables=True)
if not table:
# single table inheritance.