On Wed, Mar 05, 2008 at 01:25:18PM -0500, Michael Bayer wrote: > On Mar 5, 2008, at 1:00 PM, Christoph Haas wrote: > > > But now I'm curious. Why do I get the ArgumentError if I try > > > > .filter(Company==my_company) > > > > while > > > > .filter(Company.id==my_company.id) > > > > works? I was comparing ORM objects directly instead of fields/ > > properties > > of a mapped object. But shouldn't that work, too? > > The relation()-based descriptors are the ones which are aware of > comparisons to instances, i.e. Department.company==<somecompany>. Try > saying "print Department.company==mycompany" to see how that works.
The latter works perfectly. Not that I would desperately need to have instances compared as filter criteria. But it was my first intuitive approach and I was confused by the error message. Just curious. Nothing that would have to get implemented. SQLAlchemy is just not intuitive (to me). :) Thanks for your time. Cheers Christoph -- [EMAIL PROTECTED] www.workaround.org JID: [EMAIL PROTECTED] gpg key: 79CC6586 fingerprint: 9B26F48E6F2B0A3F7E33E6B7095E77C579CC6586 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
