Dnia 2009-11-24, Wt o godzinie 11:18 +0100, Christian Démolis pisze:
> Is it possible to put a filter on a relation in the declaration?
> 
> Example :
> LeNomDuUtilisateur = relation(Utilisateur,
> filter_by=Utilisateur.Login, backref=backref('verrouillage'))

I'm not sure what exactly your example means.. but if you want extra
filters on relation, you can change primaryjoin
http://www.sqlalchemy.org/docs/05/mappers.html#specifying-alternate-join-conditions-to-relation

something like:
LeNomDuUtilisateur = relation(Utilisateur,
primaryjoin=sqlalchemy.and_(defaultjoincondition,
yourextrafiltercondition), backref='verrouillage')


Tomasz Jezierski
Tefnet
www.tefnet.pl


--

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.


Reply via email to