On Jun 1, 2007, at 12:39 PM, Gaetan de Menten wrote:
> > This enables things like so (see attached elixir-based example for > more): > A.query().filter_by_via('b', name='b2').filter_by_via('c', > name='c2') > > To Michael: I'm ready to document that myself, but I just don't want > to do it for nothing in the unlikely event you'd agree with me that > this join_point thing should be removed. > > Another thing which I find ugly in the query class is the whole idea > of using a locate property method. It's awfully unreliable: if two > properties lead to different classes both having a property with the > same name, which one is used? I'd like if people at least had a way to > specify the full path leading to the desired property (and still use a > concise keyword syntax and not full blown where clauses). well this is all related. id like to take out the auto-descending thing out of filter_by(), *_by(), and join(). but if you take out the joinpoint, *and* the auto-descend thing which is already ambiguous, filter_by and friends become not very useful. like this would not produce the expected results at all: A.foo -> B.bar -> C.lala query(A).join(['foo', 'bar']).filter_by(lala=5) So id propose something like what you did above, but not use a string, just use the class, and have it as the first optional positional arg to all the _by()s query(A).join(['foo', 'bar']).filter_by(C, lala=5) and we can even bring back a modified version "auto-descend" in that case: query(A).filter_by(C, lala=5) since above its not ambiguous. another thing i have always wanted to do, is take the ClauseElement stuff out of the _by() methods. I know people put ClauseElements in those but that was because there used to not be a way to mix ClauseElements with keywords...now there is, just call filter() and filter_by() separately. if you agree with all that, lets just put it straight into 0.4. i think we should get a little dramatic here, make the above filtering changes, and also whack all the redundant methods: that is, get_by (), select_by(), select(), selectfirst(), selectone(),selectfirst_by (), etc etc....they get replaced with filter()/filter_by() -> list()/ scalar()/one(). this would also eliminate most of the confusion people have from the multiple "select()" functions produced by different APIs. by "whack" i havent decided if i mean, "whack", or "deprecate and remove from main docs". Id go with the latter, but a lot of other tutorial sites and such which have sprang up would have to go with me here and make similar changes to their docs....else people will keep using the old methods. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---