I wrote in my first post, that I am expecting result in SQL - close to
this one select
e.id, e.type_id, tv.version as min_version, tv2.version as
max_version
from engines e join versions tv on(e.min_version_id=tv.id) join
versions tv2 on(e.max_version_id=tv2.id) where '7.0.1.32' between
On May 23, 2009, at 5:58 AM, sniipe wrote:
I wrote in my first post, that I am expecting result in SQL - close to
this one select
e.id, e.type_id, tv.version as min_version, tv2.version as
max_version
from engines e join versions tv on(e.min_version_id=tv.id) join
versions tv2
sniipe wrote:
Hi :)
I have three tables:
1)
t_version = sa.Table(versions, meta.metadata,
sa.Column(id, sa.types.Integer(), primary_key=True,
autoincrement=True),
sa.Column(version, mysql.MSChar(length=100,
collation='utf8_polish_ci'), nullable=False, unique=True)
)
class
Ok It's working but I can't use 'between':
engine = meta.Session.query(Engine).outerjoin((Version,
Engine.min_version_id==Version.id)).filter(between(request.POST
['version'], Engine.min_version.version,
Engine.max_version.version)).all()
and I've got error:
AttributeError: Neither
Engine.min_version and max_version are instrumented column attributes.
they don't have an attribute called version. i think you want
between(x, Engine.min_version, Engine.max_version).
sniipe wrote:
Ok It's working but I can't use 'between':
engine =
that means min_version and max_version aren't columns.I guess you're
looking for Version.version, in which case you probably need to JOIN to
that table twice on both the min_version and max_version. write (and
test) the query you want in SQL first to get an idea for what you're
doing.