diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-30 17:41:47 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-30 17:41:47 -0400 |
commit | 092fbb40eb72d08a9eb433a6ac182723af774201 (patch) | |
tree | 42c4650c6845a907b0bc94399edf60dfcbc0af28 /test/orm/inheritance/test_basic.py | |
parent | 53f93a3ba71af21be5f77fcd2ee4c0d051fbdf5d (diff) | |
download | sqlalchemy-092fbb40eb72d08a9eb433a6ac182723af774201.tar.gz |
- The include_properties and exclude_properties arguments
to mapper() now accept Column objects as members in
addition to strings. This so that same-named Column
objects, such as those within a join(), can be
disambiguated.
- A warning is now emitted if a mapper is created against a
join or other single selectable that includes multiple
columns with the same name in its .c. collection,
and those columns aren't explictly named as part of
the same or separate attributes (or excluded).
In 0.7 this warning will be an exception. Note that
this warning is not emitted when the combination occurs
as a result of inheritance, so that attributes
still allow being overridden naturally.
[ticket:1896]. In 0.7 this will be improved further.
- The primary_key argument to mapper() can now specify
a series of columns that are only a subset of
the calculated "primary key" columns of the mapped
selectable, without an error being raised. This
helps for situations where a selectable's effective
primary key is simpler than the number of columns
in the selectable that are actually marked as
"primary_key", such as a join against two
tables on their primary key columns [ticket:1896].
Diffstat (limited to 'test/orm/inheritance/test_basic.py')
-rw-r--r-- | test/orm/inheritance/test_basic.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/orm/inheritance/test_basic.py b/test/orm/inheritance/test_basic.py index b4aaf13ba..c6dec16b7 100644 --- a/test/orm/inheritance/test_basic.py +++ b/test/orm/inheritance/test_basic.py @@ -981,7 +981,8 @@ class OverrideColKeyTest(_base.MappedTest): # s2 gets a new id, base_id is overwritten by the ultimate # PK col assert s2.id == s2.base_id != 15 - + + @testing.emits_warning(r'Implicit') def test_override_implicit(self): # this is how the pattern looks intuitively when # using declarative. @@ -1143,7 +1144,9 @@ class OptimizedLoadTest(_base.MappedTest): # redefine Sub's "id" to favor the "id" col in the subtable. # "id" is also part of the primary join condition - mapper(Sub, sub, inherits=Base, polymorphic_identity='sub', properties={'id':sub.c.id}) + mapper(Sub, sub, inherits=Base, + polymorphic_identity='sub', + properties={'id':[sub.c.id, base.c.id]}) sess = sessionmaker()() s1 = Sub(data='s1data', sub='s1sub') sess.add(s1) |