> One thing I'm wondering: is there some source of documentation that I'm
> missing? The filter() method doesn't seem to be described anywhere in the
> official docs at http://www.sqlobject.org/SQLObject.html
> 
> Dan

Indeed, documentation on SelectResults is pretty sparse -
http://www.sqlobject.org/class-sqlobject.sresults.SelectResults.html is about
it. I'm a heavy abuser of it, I'll see if I can write up some docs in the next
few days.

Note, it's not that filter knows how to join the tables, it's the clause that's
already tucked away in self.roles that knows how to do the join. If you print
self.roles.clause you'll see something like:

UserRole.userID = 1 AND UserRole.roleID = Role.id

And if you print self.roles.filter(UserRole.q.active == True).clause you'll see:

UserRole.userID = 1 AND UserRole.roleID = Role.id AND (UserRole.active = True)

If you look at the source you'll see that filter is a trivial AND of the
existing and new clauses.

- Luke


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to