- attached selectfirst.py
get_by and inheritance
Issue #122
resolved
When using the get_by or get_by_something method of a mapper that inherits a base mapper, for a column that exists in the base-mapper an exception occurs:
line 286, in visit_select
orderby = "%s.rowid ASC" % select.froms[0](0).name
AttributeError: 'JoinMarker' object has no attribute 'name'
Below a test-programm for the issue.
from sqlalchemy import *
engine = create_engine('oracle://dsn=orcl&user=test&password=test')
foo = Table('foo', engine,
Column('id', Integer, Sequence('foo_seq'), primary_key=True),
Column('something', String(255))
)
bar = Table('bar', engine, Column('id', Integer, ForeignKey('foo.id'), primary_key=True))
class Foo(object): pass
class Bar(object): pass
foos = mapper(Foo, foo)
bars = mapper(Bar, bar, inherits=foos)
bars.get_by(something='asdf')
Comments (3)
-
Account Deleted -
Account Deleted see the atachement for the new error I get. I guess now it's get_by, selectfirst and selectfirst_by that is broken. It might be an oracle-only problem now.
-
repo owner - changed status to resolved
oracle needed to tune its efforts to retrieve an ORDER BY column in all cases for its ROW NUMBER clause..fixed in changeset:1184
- Log in to comment
demonstration of brokeness of get_by, selectfirst and selectfirst_by