i'll assume we're using the standard identity framework.

let's say a have a couple users, and a couple groups.  i want the users
to be presented with a select box showing all the groups they can join.
 obviously i don't want any groups the user is already a member of to
show up in this select box.

is there a way to select all groups that do not have a related join
defined to a given user?

I realize that i could do something like this:

groups = Group.select()
for group in groups:
   if group in user.groups:
      del(group)

but i would prefer to let the database take care of this.  i've tried
this:

select = Group.select(NOTIN(Group.q.id, user.groups))

but user.groups is a list, not a select query, so it fails.

any ideas?


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to