Hi,
You can define a SA object associated to the table tarife_dossier:
- you set its IdDossier (IdAt) attributes to its associated dossier
(article) id
- or you set dossier (article_tarife) to its associated dossier (articke)
object
and you save it !
PS: tarife ou tarif ?
On Thursday, March 15, 2012 12:38:26 PM UTC+1, Christian Démolis wrote:
>
> 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
>
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/FZb31d8fPMcJ.
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.