17 May 19:21
Re: RelatedJoin
From: Luis Javier Peris <javierperis <at> gmail.com>
Subject: Re: RelatedJoin
Newsgroups: gmane.comp.python.sqlobject
Date: 2008-05-17 17:21:56 GMT
Subject: Re: RelatedJoin
Newsgroups: gmane.comp.python.sqlobject
Date: 2008-05-17 17:21:56 GMT
Thanks for the example.
2008/5/17 Luke Opperman <loppear <at> gmail.com>:
First off, let me say I feel RelatedJoin and MultipleJoin should be deprecated
to be renamed RawRelatedJoin/RawMultipleJoin, there are two better alternatives
available since at least 0.8:
* SQLRelatedJoin and SQLMultipleJoin
* ManyToMany and OneToMany
Yes, the docs need a massive overhaul on this topic - I don't believe ManyToMany
and OneToMany are mentioned at all.
These both have the advantage over the Raw versions of returning SelectResults
instances: lazy, filterable etc result sets same as is returned by .select()
They differ in how you perform the C*UD operations you're asking about, in short
ManyToMany has .add(obj), .remove(obj), .create(kw) methods under obj.joinName,
whereas SQLRelatedJoin adds methods to the class: .addJoinName(obj) and
.removeJoinName(obj). If you choose to keep using RelatedJoin, it acts like
SQLRelatedJoin in this aspect.
I've put a doctest example of these and a little more up at
http://freehg.org/u/loppear/sqlobject_play/file/5cf57a8ce206/m2m_versus_sqljoin.py
- Luke
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ sqlobject-discuss mailing list sqlobject-discuss <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
RSS Feed