transformed to the empty slice -1:0 that resulted in
IndexError. [ticket:1968]
+ - The mapper argument "primary_key" can be passed as a
+ single column as well as a list or tuple. [ticket:1971]
+ The documentation examples that illustrated it as a
+ scalar value have been changed to lists.
+
- sql
- The 'info' attribute of Column is copied during
Column.copy(), i.e. as occurs when using columns
self.class_manager = None
- self.primary_key_argument = primary_key
+ self.primary_key_argument = util.to_list(primary_key)
self.non_primary = non_primary
if order_by is not False:
User(id=9, address_id=5),
None])
+ @testing.resolve_artifact_names
+ def test_scalar_pk_arg(self):
+ m1 = mapper(Item, items, primary_key=[items.c.id])
+ m2 = mapper(Keyword, keywords, primary_key=keywords.c.id)
+ m3 = mapper(User, users, primary_key=(users.c.id,))
+
+ assert m1.primary_key[0] is items.c.id
+ assert m2.primary_key[0] is keywords.c.id
+ assert m3.primary_key[0] is users.c.id
+
+
@testing.resolve_artifact_names
def test_custom_join(self):
"""select_from totally replace the FROM parameters."""