- attached query.py.diff
multi-primary key message in query._get() is busted
change is obvious from the diff. If one has a table with a multi-column primary key and you attempt to do a session.get(i) (i.e. pass in a scalar) or session.get((i,)) (i.e. pass in a tuple of the wrong length), the exception fails with an AttributeError (our session is instantiated with query_cls=CachingQuery but a similar error occurs in the distributed sqlalchemy)
"query.get(); primary key columns are %s" % ', '.join("'%s'" % c for c in q.mapper.primary_key)) AttributeError: 'CachingQuery' object has no attribute 'mapper'
Comments (6)
-
reporter -
repo owner - marked as bug
- changed milestone to 0.5.5
- changed component to orm
- changed title to multi-primary key message in query._get() is busted
- marked as critical
needs a test case in test/orm/test_query.py too (I love nose !!!)
-
reporter - attached mpck.diff
unit-tests for the mpck get (not sure if these work as I not yet get nosetests up and running on top of the SA development tree)
-
reporter Mike, does this test-case work for you?
-
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.5.5 (automated comment)
- Log in to comment
path to sqlalchemy.orm.query