[sqlalchemy] Re: Bug in selection from many-to-many relationship?

2007-06-25 Thread Michael Bayer
On Jun 24, 2007, at 10:52 PM, Hong Yuan wrote: mapper(Address, address) person_address_mapper = mapper(PersonAddress, person_address, properties={'address': relation(Address, lazy=False)} ) personmapper = mapper(Person, person, properties={ 'addresses':

[sqlalchemy] Re: Bug in selection from many-to-many relationship?

2007-06-24 Thread Hong Yuan
Hi, I just find that if I introduct an association object for the many-to- many relationship, then the selection seems problematic. With the above, I added an PersonAddress class as the association class, then selects against the address table columns. The select statement produced this time,

[sqlalchemy] Re: Bug in selection from many-to-many relationship?

2007-06-23 Thread Hong Yuan
On 6月23日, 上午12时45分, Michael Bayer [EMAIL PROTECTED] wrote: its correct. the LEFT OUTER JOINs above are the result of the lazy=False eager load you have switched on...if you set lazy=True, you will see the actual statement you are creating via your Query. Because the OUTER JOIN tables are

[sqlalchemy] Re: Bug in selection from many-to-many relationship?

2007-06-22 Thread Michael Bayer
On Jun 22, 12:11 pm, Hong Yuan [EMAIL PROTECTED] wrote: Hi, With SQLAlchemy 0.3.8, I wanted to select from a many-to-many relationship with ORM, and found that if the select condition contains fields in the relation table, the relation table will be duplicated in the select statement and