On Dec 16, 2008, at 3:04 PM, [email protected] wrote:
> > hi > i have a relation say, foo. i want to have another descriptor, bar > that does certain other things around that relation, but can be used > just in same way as foo can in the aspects of expressions and > query-joins. > > i.e. query(A).join( A.foo) and query(A).join( A.bar) > to produce same thing; as well as > query(A).filter( A.foo == x) and query(A).filter( A.bar == x). this is the use case for synonym(). > i managed to get the latter by simulating the PropComparator > interface, and i sort of managed to get the join working... > but my relation is to an explicit association and i want to hide the > explicitness. so i want query(A).join( A.bar) > to behave same as > query(A).join( A.bar).join( FooAssoc.otherside), > or actualy as query(A).join( A.foo) as IF foo was implicit association > via secondary table. ignoring the "A.bar would be 'the same' as A.bar.otherside" portion of what you said, since that doesn't make any sense, it seems you're asking for A.foo to mean the same thing as A.bar.otherside. this seems something like associationproxy plus a comparable_property(). have you tried that ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
