Say we have a many-to-many relation:
mapper(Group, group_tbl,
properties={'users' : relation(User, secondary=group_user_tbl) }
)
group_user_tbl = Table('group_user', metadata,
Column('group_id', Integer, ForeignKey('group.group_id')),
Column('user_id', Integer, ForeignKey('user.user_id')),
Column('expiry', DateTime)
)
Is there any way to make the 'expiry' an attribute to the User of a
particular Group?
eg.
my_group = session.query(Group).get(30)
u = my_group.users[0]
exp = u.expiry
exp = datetime.datetime.now()
session.flush()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---