>how it can hint the query.join() to jump over to otherside. >oh well. seems i'll have to overload query.join / filter_by to do >this "syntax" sugar for me... the internal logic of obtaining >secondary_table is too complicated to try cheating it. hmm, or i'll try having two relations at same time, one explicit assoc, one implicit assoc but never-ever-used except for query.join etc. let's see.
On Wednesday 17 December 2008 00:35:03 Michael Bayer wrote: > 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 -~----------~----~----~----~------~----~------~--~---
