Lee McFadden wrote:
> Commenting out one or the other of those lines (but not both) is the
> fix for this little bug in the quickstart template.  Did you restart
> tg-admin shell after making the changes to your model.py?

Yes! I'm not that stupid :-P Observe:

[EMAIL PROTECTED]:/www/dg-admin$ tg-admin shell
Python 2.4.3 (#2, Oct  6 2006, 07:52:30)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(CustomShell)
>>> User.relations
{'groups': <sqlalchemy.ext.activemapper.many_to_many object at 0xb7442aec>}
>>> Group.relations
{'permissions': <sqlalchemy.ext.activemapper.many_to_many object at
0xb744252c>}
>>> User.get(1).groups
[2006-10-23 15:51:50,663] [engine]: SELECT tg_user.user_id AS
tg_user_user_id, tg_user.created AS tg_user_created, tg_user.user_name
AS tg_user_user_name, tg_user.display_name AS tg_user_display_name,
tg_user.password AS tg_user_password, tg_user.email_address AS
tg_user_email_address
FROM tg_user
WHERE tg_user.user_id = %s ORDER BY tg_user.user_id
[2006-10-23 15:51:50,664] [engine]: [1]
Traceback (most recent call last):
  File "<console>", line 1, in ?
AttributeError: 'User' object has no attribute 'groups'
>>> Group.get(1).users
[2006-10-23 15:51:52,196] [engine]: SELECT tg_group.group_name AS
tg_group_group_name, tg_group.group_id AS tg_group_group_id,
tg_group.display_name AS tg_group_display_name, tg_group.created AS
tg_group_created
FROM tg_group
WHERE tg_group.group_id = %s ORDER BY tg_group.group_id
[2006-10-23 15:51:52,196] [engine]: [1]
Traceback (most recent call last):
  File "<console>", line 1, in ?
AttributeError: 'Group' object has no attribute 'users'
>>>


Notice how Group.relations doesn't contain the "users" relation, which
it would if I hadn't commented one of them out.

-Rob

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