On Mon, Apr 30, 2007 at 09:56:51PM -0400, [EMAIL PROTECTED] wrote:
> class MoneyStream(SQLObject):
>      users = RelatedJoin('User')
>      label = UnicodeCol()
> 
> class User(SQLObject):
>      moneystreams = RelatedJoin('MoneyStream')
> 
> What I want to do is, given a user (current.user) and a
> label, find the MoneyStream that with that label that
> has that user in its users list.  How do I write the
> select?  Or should I just scan through User.moneystreams?

http://sqlobject.org/FAQ.html#how-can-i-do-a-left-join

   You have already got a piece of advice to loop over user.moneystreams.
This is SQLObject way to do.
   If you want to do a join in SQL you have to declare and recreate
intermediate table:

http://sqlobject.org/FAQ.html#how-can-i-define-my-own-intermediate-table-in-my-many-to-many-relationship

   and do a 3-tables join.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to