Oleg Broytmann schrieb: > On Wed, Nov 14, 2007 at 12:35:58AM +0100, Nicolas Riedel wrote: >> Thanks for the quick answer, but that's not quite what I need. With this >> way I can't neither use .reversed() nor do somthing like >> .select(orderBy=xxx) > > You can do this by using SQLRealtedJoin (it returns SelectResult objects > instead of lists). > Using it like this:
users = RelatedJoin("User", intermediateTable="todo_user", joinColumn="todo_id", otherColumn="user_id") what do you mean? users = SQLRelatedJoin("User", intermediateTable="todo_user", joinColumn="todo_id", otherColumn="user_id") and then it should work? >> select todos, that belong to user A and user B. :( > > To do this you have to understand that RelatedJoins use an intermediate > table. If you have to do complex queries you have to join with the > intermediate table, and to do that you have to declare the table: > > http://sqlobject.org/FAQ.html#how-can-i-define-my-own-intermediate-table-in-my-many-to-many-relationship I don't get it, why use sqlobject, when I have to do anything more complicated than a select by hand? > > Oleg. -- [EMAIL PROTECTED] ICQ: 52364961 Jabber: [EMAIL PROTECTED] ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss