Christian Démolis
unread,Mar 15, 2012, 7:38:26 AM3/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlalchemy
Hi all,
DossierTarife = Table('tarifer_dossier', Base.metadata,
Column('IdDossier', Integer, ForeignKey('dossier.IdDossier')),
Column('IdAt', Integer, ForeignKey('article_tarife.IdAt'))
)
Dossier.LesTar = relation(ArticleTarife, secondary=DossierTarife, backref=backref('dossier'))
ArticleTarife.LesTar = relation(Dossier, secondary=DossierTarife, backref=backref('article_tarife'))
When i want to change a many to many relation, the tutorial says that i must add object in the relationship (list) :
self.tarif_cible.LesTar.append(d)
where d is an instance of Dossier. But Dossier is an heavy table, so object is heavy too.
Is it any other simple way to change a many to many association (example : directly access DossierTarife table) ???
Thx in advance,
Chris