I guess the solution to my problem is simple, although I did not
manage to find it.

The problem is as follows: I calculate the bray-curtis distance
between an input and the rows in my table and give the value an alias
('brayCurtis'). What I want is to order the resultSet by brayCurtis
and return only those rows where the value exceeds a given threshold.
Ordering is pretty simple

query = query.order_by(query.c.brayCurtis.desc())

The problem occurs if I want to add an additional where clause like
this:

query = query.where(query.c.brayCurtis >= cutoff)

Suddenly the whole statement is duplicated. Maybe there is a more
concise and elegant solution for this problem.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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