Janzert schrieb:
> 1. All the TG related code I found uses something similar to this:
>      @property
>      def permissions(self):
>          p = set()
>          for g in self.groups:
>              p |= set(g.permissions)
>          return p
> 
> 2. Why not something like the following (untested code)?
>      @property
>      def permissions(self):
>          p_q = session.query(Permission).join(['tg_group', 'tg_user'])
>          p_q.filter_by(user_id = self.user_id)
>       return p_q.all()

No reason than simplicity and readability, I think. There's always a 
tradeoff between optimization and readable code. Patches are welcome, 
though. But please make sure that it works with all SQLAlchemy version 
 >=0.3.

Chris

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