I cant reproduce this behavior:  the Reminder mapper definitely has  
an 'item' property on it as you describe, and also if it didnt, thats  
not the error message you would get for that line.

can you please submit  a fully working test case ?


On Jul 4, 2006, at 11:06 PM, Steve Zatz wrote:

> It seems that if you define a mapper relationship through a backref,
> that relationship does not appear to be 'visible' when setting options
> on a query.
>
> For example:
>
> mapper(Item, item_table, properties = {'reminder': relation(Reminder,
> backref='item')})
>
> mapper(Reminder, reminder_table)
>
> If you then try to do the following:
>
>>>> query = session.query(Reminder).options(eagerload('item'))
>
> You get...
>
> AttributeError: 'Reminder' object has no attribute 'item'
>
> So even thought there is a backref, should the mapper for Reminder be:
>
> mapper(Reminder, reminder_table, properties = {'item':relation 
> (Item)}) ?
>
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to