I'm using TG 0.9a5 and have the same "by_user_name" error (before).
After reviewing the change of "identity/soprovider.py" from TG 0.9a4 to
TG 0.9a5,
I found that, in the "TG_User" class of TG 0.9a5,
the "user_name" have an additional parameter:
alternateMethodName="by_user_name".
And this may be the cause of "by_user_name" error.
So I did the following modification to the model.py of FastTrack 0.5,
and it works.

class Person(SQLObject):
    displayName     = StringCol(length=255, alternateID=True)
    user_name       = StringCol(length=16, alternateID=True,
                                alternateMethodName="by_user_name")
    password        = StringCol()
    emailAddress    = StringCol(length=255, alternateID=True,
                                alternateMethodName="by_email_address")
    
    groups = RelatedJoin("Groups", intermediateTable="tg_user_group",
                         joinColumn="user_name",
otherColumn="group_name")
    
    def _get_permissions( self ):
        perms = set()
        for g in self.groups:
            perms = perms | set(g.permissions)
        return perms

class Groups(SQLObject):
    group_name  = StringCol(length=16, alternateID=True,
                            alternateMethodName="by_group_name")
    displayName = StringCol(length=255)
    created     = DateTimeCol(default=datetime.now)
    
    # collection of all users belonging to this group
    users       = RelatedJoin("Person", 
                              intermediateTable="tg_user_group",
                              joinColumn="group_name", 
                              otherColumn="user_name")
    
    # collection of all permissions for this group
    permissions = RelatedJoin("Permission", 
                              joinColumn="group_name", 
                              intermediateTable="tg_group_permission",
                              otherColumn="permission_name")

class Permission(SQLObject):
    permission_name = StringCol(length=16, alternateID=True,

alternateMethodName="by_permission_name")
    description     = StringCol(length=255)
    groups          = RelatedJoin("Groups", 

intermediateTable="tg_group_permission",
                                  joinColumn="permission_name", 
                                  otherColumn="group_name")


I hope this can help.

- Cox Chen


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