[Sqlalchemy-tickets] [sqlalchemy] #2733: using backref raises AttributeError when querying column-b
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-05-24 19:25:59
|
#2733: using backref raises AttributeError when querying column-based entities
[declarative extension]
-------------------------+-----------------------------------------
Reporter: andrija | Owner: zzzeek
Type: defect | Status: new
Priority: lowest | Milestone:
Component: declarative | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
-------------------------+-----------------------------------------
[both sqlalchemy 0.8.1 and default branch / Python 2.7.3 / Ubuntu 12.04]
Addressing "backref" attribute will raise an !AttributeError in case of
querying column-based entities (`Child.parents` is specified with backref
in `Parent` class):
{{{session.query(Child.id).join(Child.parents)}}}
This will not raise exception if `Child` or `Parent` entities are used in
a query before.
See the attached code for the full example.
I'm not sure if this is a bug or should be expected behaviour. I haven't
tried to reproduce it without declarative extension.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2733>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|