Re: [sqlalchemy] Unexpected return type of aggregate query.

2014-11-12 Thread Thomas Wanschik
When using echo='debug' I get the following: In [22]: session.query(func.sum(Event.cycle)).scalar() 2014-11-12 08:14:35,697 INFO sqlalchemy.engine.base.Engine SELECT sum(metrics_event.cycle) AS sum_1 FROM metrics_event SELECT sum(metrics_event.cycle) AS sum_1 FROM metrics_event 2014-11-12

[sqlalchemy] [Q] Relative speed of different querying methods

2014-11-12 Thread Ladislav Lenart
Hello. I am in the process of eliminating bottlenecks in our application. I have measured relative speed of the following querying methods: limit = 1 q_orm = session.query(Foo).limit(limit) q_id = session.query(Foo.id).limit(limit) # primary key stmt = q_id.statement sql = SELECT foo.id FROM

Re: [sqlalchemy] Wrong type when processing returned value using a correlated subquery

2014-11-12 Thread Bruno
Thank you! I can confirm it works. On Tuesday, 11 November 2014 17:36:24 UTC, Michael Bayer wrote: this is fixed for 0.9.9 which you can get from git right now. On Nov 11, 2014, at 10:53 AM, Michael Bayer mik...@zzzcomputing.com javascript: wrote:

Re: [sqlalchemy] Backref Fetch all Related Records Instead of Those Meeting the Search Criteria

2014-11-12 Thread Michael Bayer
I would advise dealing with the EventRegistration objects separately: for user, registration in session.query(User, EventRegistration)….. # process that way you don’t need to use contains_eager() and the rows you want are explicitly present. Collections aren’t really meant for filtered

Re: [sqlalchemy] Unexpected return type of aggregate query.

2014-11-12 Thread Michael Bayer
On Nov 12, 2014, at 3:18 AM, Thomas Wanschik twansc...@googlemail.com wrote: When using echo='debug' I get the following: In [22]: session.query(func.sum(Event.cycle)).scalar() 2014-11-12 08:14:35,697 INFO sqlalchemy.engine.base.Engine SELECT sum(metrics_event.cycle) AS sum_1 FROM

Re: [sqlalchemy] [Q] Relative speed of different querying methods

2014-11-12 Thread Michael Bayer
On Nov 12, 2014, at 4:46 AM, Ladislav Lenart lenart...@volny.cz wrote: Hello. I am in the process of eliminating bottlenecks in our application. I have measured relative speed of the following querying methods: limit = 1 q_orm = session.query(Foo).limit(limit) q_id =

[sqlalchemy] Problem installing

2014-11-12 Thread Matthew Albert
Hi, Downloaded SQLAlchemy 0.9.8 and installed on my win7 machine on python 3.4 using: python setup.py install. Installation text seems to indicate a successful install: http://pastebin.com/zcMzMn1e ... but when I attempt to issue: import sqlalchemy I get a ImportError: No module named

Re: [sqlalchemy] Problem installing

2014-11-12 Thread Michael Bayer
what does your sys.path say in the python console? the pip looks like a network issue. On Nov 12, 2014, at 3:25 PM, Matthew Albert steelfire...@gmail.com wrote: Hi, Downloaded SQLAlchemy 0.9.8 and installed on my win7 machine on python 3.4 using: python setup.py install. Installation

[sqlalchemy] Re: Problem installing

2014-11-12 Thread Matthew Albert
sys.path ['C:\\Python34\\lib\\site-packages\\pygame\\tests', 'C:\\Python34\\lib\\site-packages\\pygame', 'C:/Python34/Programs/SQLAlchemy Tutorial', 'C:\\Python34\\Lib\\idlelib', 'C:\\Python34\\lib\\site-packages\\pypyodbc-1.3.3-py3.4.egg',

Re: [sqlalchemy] Backref Fetch all Related Records Instead of Those Meeting the Search Criteria

2014-11-12 Thread 翁哲
Thanks for your advice. What we want is a collection of all the selected even registrations for each users. Certainly we can manipulate the process in you suggested way, with adding an extra directory, may be list, to collect all the registrations. Besides, I see in Hibernate they have

[sqlalchemy] PostgreSQL's TIME WITH TIME ZONE issue

2014-11-12 Thread Hyunjun Kim
Greetings, I'm trying to use PostgreSQL's TIME WITH TIME ZONE type. I've used SQLAlchemy's generic type Time(timezone=True) and it was successful that the schema was reflected to TIME WITH TIME ZONE(timetz) when I use alembic or metadata.create_all(). The problem is, it seems that the