thanks ajones.

I dont know why now it works so far. I got the next question. In a
Testproject i have just the model like this:


class Person(SQLObject):
   displayName     = StringCol(length=255, alternateID=True)
   userId          = StringCol(length=32, alternateID=True)
   password        = StringCol()
   emailAddress    = StringCol()

   groups = RelatedJoin("Groups", intermediateTable="tg_user_group",
                        joinColumn="user_id", otherColumn="group_id")

   def _get_permissions( self ):
       perms = set()
       for g in self.groups:
           perms = perms | set(g.permissions)
       return perms

class Groups(SQLObject):
   groupId     = StringCol(length=16, alternateID=True)
   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_id",
                             otherColumn="user_id")
   # collection of all permissions for this group
   permissions = RelatedJoin("Permission",
                             intermediateTable="tg_group_permission",

                             joinColumn="group_id",
                             otherColumn="permission_id")
class Permission(SQLObject):
   permissionId    = StringCol(length=16, alternateID=True)
   description     = StringCol(length=255)
   groups          = RelatedJoin("Groups",
                                 intermediateTable="tg_group_permission",
                                 joinColumn="permission_id",
                                 otherColumn="group_id")


After i did:

import tgfastdata stuff

person = DataController(model.Person)
group = DataController(model.Group)

Now i have Crud Access to the Tables but i cant see any Relation.
Should there not be Displayed a Relation?

Somone have a Hint?

Thanks in Advance.

Best Regards Ivo



On 4/5/06, ajones <[EMAIL PROTECTED]> wrote:
>
> It looks like one of your relation tables already exists. Check the
> RelatedJoin in Person, should that be "tg_user_group" for an
> intermediate table or "tg_person_group"? From the looks of it your
> Person table was initially named User and caused you some problems. If
> that was the case in addition to renaming User to Person for the class
> you will have to do it in your foreign keys and joins as well.
>
>

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