Graham Higgins wrote: > The branch-contained SQLAlchemy identity templates specify a > many-to-many mapping for both user/group and group/permissions > relationships and also create a pair of supporting tables for > user_id/group_id and group_id/permission_id. > > I see that the columns in the supporting tables are declared as > primary_key=True. > > I thought it was the case that primary keys must be unique and the > usage here to support a many-to-many relationship will run into trouble > with multiple instances of the same id (at least I have, using this > scheme under PostgreSQL). > > Am I missing something?
I believe SQLAlchemy supports composite primary keys (e.g., there are many instances of the same user_id, and many instances of the same group_id, but the combination of user_id and group_id uniquely identifies a particular row). In http://www.sqlalchemy.org/docs/metadata.myt, the second example shows a composite primary key, and another table that references it with a composite foreign key. -- Robin Munn [EMAIL PROTECTED] GPG key 0xD6497014 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

