Christoph Zwerschke wrote:
> Still, this join query produces more results than necessary.

As a compromize we could eliminate the duplicates on the database level 
already so that they are not returned by the query:

     def permissions(self):
         return set(Permission.query.distinct().join(['groups',
             'users']).filter_by(user_id=self.user_id))

Note that I also removed the all(): It is not necessary if we convert to 
a set, since the query itself is iterable.

-- Christoph

--~--~---------~--~----~------------~-------~--~----~
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