In addition to Kevin's comment about only accessing the current identity during a request, you should probably keep in mind that the groups set is only the IDs of the groups, not the groups themselves -- this was done to minimise the impact of the actual model. If you want the model specific data, you'll have to access the user object. If you're using the default SqlObjectIdentityProvider with the default TG_* classes, the following is more what you're looking for:

    options= [(group.groupId, group.displayName) for group \
              in identity.current.user.groups]

I'll see what I can do about making the exception check whether there's a request active... it would be much smarter to have the exception say something like: I know you've turned on Identity, however, you're using code that can only execute during an HTTP request...

On 21 Mar, 2006, at 9:28 am, Richard (koorb) wrote:

options=[(group.id, group.displayName) for group in

identity.current.groups]


--
Jeff Watkins

"Advertising directed at children is inherently deceptive and exploits children under eight years of age."
-- American Academy of Pediatrics



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

Reply via email to