Jurgens de Bruin schrieb:
> I just installed version of TurboGears and have create a new project
> which includes indentity and uses SQLAlchemy. By default I get the
> following error when I want to add restriction to a webpage by checking
> if a users belongs to a group.
>
> File
> "/usr/local/lib/python2.4/site-packages/TurboGears-1.0b1-py2.4.egg/turbogears/identity/saprovider.py",
> line 81, in _get_groups
> self._groups = frozenset([g.group_name for g in self.user.groups])
>
>
> AttributeError: 'User' object has no attribute 'groups'
The 'groups' attribute of the 'User' model class should be defined by
the SA mapper in your model.py file. There should be code like this:
mapper(Group, groups_table,
properties=dict(users=relation(User,
secondary=user_group_table, backref='groups')))
Check your model.py file whether it is correct.
Also you are using a very old TurboGears 1.x version. I suggest that you
at least upgrade to the latest 1.0.x version or even 1.1 beta.
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
-~----------~----~----~----~------~----~------~--~---