Am 21.05.2013, 17:31 Uhr, schrieb Etienne Rouxel <rouxel.etie...@gmail.com>:

if __name__ == '__main__':
   engine = create_engine('postgresql://user@localhost:5432/mydatabase')
    Session = sessionmaker(bind=engine)
    session = Session()
   session.query(Descriptiontype).get(-2147483648)
    session.query(Descriptiontype).get(-2147483648)
    session.query(Descriptiontype).get(-2147483648)

Each call to session.query() is creating a new query object, thus, a new query will run on the DB.

Try:
q = session.query(Descriptiontype)
q.get(-24…)

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226

--
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
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