On Oct 13, 2010, at 10:48 AM, Christian Démolis wrote: > Hi, > > q = model.session.query( > # > model.Collaborateur.LesIns.any(model.or_(model.Instruction.FinValidite>time.time(), > model.Instruction.FinValidite==None)), > model.Collaborateur.Fonction > ) > q = q.limit(5) > print str(q) > for e in q.all() : > print "Fonction", e.Fonction > > This is the result (result1.jpg) > > > > q = model.session.query( > model.Collaborateur.LesIns.any(model.or_(model.Instruction.FinValidite>time.time(), > model.Instruction.FinValidite==None)),
> model.Collaborateur.Fonction > ) > q = q.limit(5) > print str(q) > for e in q.all() : > print "Fonction", e.Fonction The SQL is correct. The any() has no label and is throwing off the label names - this is a bug and is fixed in rd67812029db9, downloadable at http://hg.sqlalchemy.org/sqlalchemy/archive/default.tar.gz . Otherwise, apply any(...).label('some label') so that e.Fonction targets the column you want. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.