this looks a little weird to me, because it seems like you're using parts
of the ORM (namely sessionmaker) and the rest is the Engine.
anyways, you want to address the `table.column`; the results don't exist
yet.
you can print out any query whenever you'd like
below are 2 ways to generate the query ( i stripped the db , and just print
it for you )
-------
from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
, Sequence , Boolean
metadata = MetaData()
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql.expression import select
location = Table('location', metadata,
Column('id', Integer, Sequence('seq_location_id')),
Column('name', String(256), nullable=False),
Column('domestic', Boolean, default=False),
)
def test_append_whereclause_1():
query = select(
columns=[location.c.id.label('id')],
from_obj=location,
whereclause=location.c.id>50
)
query.append_whereclause(location.c.id < 100)
print query
def test_append_whereclause_2():
query = select(
columns=[location.c.id.label('id')],
from_obj=location,
whereclause=location.c.id>50
).where(location.c.id < 100)
print query
test_append_whereclause_1()
test_append_whereclause_2()
--
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.
For more options, visit https://groups.google.com/groups/opt_out.