dont use "secondary", use an association object which makes your m2m table a fully mapped table of its own. its described in the docs.
On Mar 18, 2007, at 3:42 AM, tml wrote: > > Hello! > > I have this code in my model: > > user_group_table = Table('user_group', metadata, > Column('user_id', Integer, ForeignKey('tg_user.user_id')), > Column('group_id', Integer, ForeignKey('tg_group.group_id')), > Column('officer', Boolean), > Column('moderator', Boolean), > mysql_engine='InnoDB' > ) > > I do this relation for looking up groups.users: > > assign_mapper(session.context, Group, group_table, > properties=dict(users=relation(User,secondary=user_group_table, > backref='groups'))) > > > In above way, i have no way to know if the group.users are officers or > moderators in a given group. How can i get this info too as part of > the user? > > Should i do this or make seperate tables for group_officers, > group_moderator? > > thanks much. > > -tml > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---