in the way that occurs if you called
it on Query().subquery(). [ticket:2190]
+ - Fixed declarative bug where a class inheriting
+ from a superclass of the same name would fail
+ due to an unnecessary lookup of the name
+ in the _decl_class_registry. [ticket:2194]
+
- mssql
- Adjusted the pyodbc dialect such that bound
values are passed as bytes and not unicode
if 'inherits' not in mapper_args:
for c in cls.__bases__:
if _is_mapped_class(c):
- mapper_args['inherits'] = cls._decl_class_registry.get(
- c.__name__, None)
+ mapper_args['inherits'] = c
break
if hasattr(cls, '__mapper_cls__'):
assert 'inherits' not in Person.__mapper_args__
assert class_mapper(Engineer).polymorphic_identity is None
assert class_mapper(Engineer).polymorphic_on is Person.__table__.c.type
-
+
def test_we_must_only_copy_column_mapper_args(self):
class Person(Base):
}
assert class_mapper(Person).version_id_col == 'a'
assert class_mapper(Person).include_properties == set(['id', 'a', 'b'])
-
-
+
+
def test_custom_join_condition(self):
class Foo(Base):
assert_raises_message(sa.exc.ArgumentError,
'place __table_args__', go)
+ @testing.emits_warning("The classname")
+ def test_dupe_name_in_hierarchy(self):
+ class A(Base):
+ __tablename__ = "a"
+ id = Column( Integer, primary_key=True)
+ a_1 = A
+ class A(a_1):
+ __tablename__ = 'b'
+
+ id = Column(Integer(),ForeignKey(a_1.id), primary_key = True)
+
+ assert A.__mapper__.inherits is a_1.__mapper__
+
def test_concrete(self):
engineers = Table('engineers', Base.metadata, Column('id',
Integer, primary_key=True,