basd on a bunch of error messages, this example works...

    criteria = ( ('male',35),('female','35) )
    query = session.query( model.Useraccount )
    ands = []
    for set_ in criteria :
                ands.append(\
                        sqlalchemy.sql.expression.and_(\
                                model.Useraccoun.gender == set_[0] ,
                                model.Useraccoun.age == set_[1] ,
                        )
                )
        query = query.filter(\
                sqlalchemy.sql.expression.or_( *ands )
        )
        results= query.all()

this seems really awkward though.  is there a better way to build up a
set of dynamic "or" criteria ?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to