[sqlalchemy] Are sqlalchemy queries a generator?

2013-04-26 Thread alonn
so not to load too much into memory I should do something like: for i in session.query(someobject).filter(idsomething) print i I'm guessing the answer is no, because of the nature of sql, but I'm not an expert so I'm asking. Thanks for the help! -- You received this message because you

[sqlalchemy] sqlalchemy failing to commit somewhere (but fails silently) when trying to update data

2013-03-18 Thread alonn
Like all CRUD goes, I need to write some data to a table. when I write new data to the table, everything works like charm. the problem starts when I need to write data already existing in the table (actually updating some data with the same primary key). the data just doesn't seem to be written

Re: [sqlalchemy] sqlalchemy failing to commit somewhere (but fails silently) when trying to update data

2013-03-18 Thread alonn
']] rec.data = newrec['data'] else: rec = MyThing(id=newrec['id'], data=newrec['data']) session.add(rec) if i % 1000 == 0: session.flush() session.commit() On Mar 18, 2013, at 1:54 AM, alonn alon...@gmail.com javascript: wrote: Like all CRUD

[sqlalchemy] question about using SAVEPOINTS

2013-03-18 Thread alonn
from the docshttp://docs.sqlalchemy.org/en/latest/orm/session.html#using-savepoint : begin_nested()http://docs.sqlalchemy.org/en/latest/orm/session.html#sqlalchemy.orm.session.Session.begin_nested may be called any number of times, which will issue a new SAVEPOINT with a unique identifier for

[sqlalchemy] Re: column_property for correlated subquery

2013-03-18 Thread alonn
If I understand the problem correctly your best shot would be using sqlalchemy magical `hybrid_property` , hybrid_method, etc. here: http://docs.sqlalchemy.org/ru/latest/orm/extensions/hybrid.html On Monday, March 18, 2013 9:20:15 PM UTC+2, millerdev wrote: Hi, Using declarative here,

Re: [sqlalchemy] sanitizing sql with sqlalchemy

2013-01-01 Thread alonn
library On Tuesday, January 1, 2013 6:19:03 PM UTC+2, werner wrote: On 31/12/2012 23:24, alonn wrote: I'm using sqlalchemy orm (with turbogears) to write data from a web application to an mssql 2005 Db (used by another application, not maintained by me). after dealing with a serious

Re: [sqlalchemy] sanitizing sql with sqlalchemy

2013-01-01 Thread alonn
, January 1, 2013 11:14:27 PM UTC+2, Tomas Vondra wrote: On 1.1.2013 21:57, Werner wrote: On 01/01/2013 19:34, alonn wrote: Actually I don't know what's causing the corruption but the . looks like the only unvalid one in a varchar field. Why would a . in a varchar field not be valid

[sqlalchemy] sanitizing sql with sqlalchemy

2012-12-31 Thread alonn
I'm using sqlalchemy orm (with turbogears) to write data from a web application to an mssql 2005 Db (used by another application, not maintained by me). after dealing with a serious case of data corruption (basically because of user data including the . sign). is there a way to use sqlalchemy

[sqlalchemy] Re: getting results uncidoe from mssql with pyodbc (where mssql encoding is windows-1255) using turbogears scoped DBSession

2012-09-04 Thread alonn
thanks! did the trick! On Tuesday, August 28, 2012 11:43:56 PM UTC+3, alonn wrote: some of my sqlalchemy 0.7.3 (with tubrogears 2.1.4) models work with a mssql 2005 db using pyodbc. (No can't change this, don't bother suggesting, this is an enterprise financial system, I can just read

Re: [sqlalchemy] getting results uncidoe from mssql with pyodbc (where mssql encoding is windows-1255) using turbogears scoped DBSession

2012-08-31 Thread alonn
if you're on the windows drivers, vs. freetds, vs anything else. also I use MSSQL 2005 in production financial applications as well. On Aug 28, 2012, at 4:43 PM, alonn wrote: some of my sqlalchemy 0.7.3 (with tubrogears 2.1.4) models work with a mssql 2005 db using pyodbc. (No can't change

Re: [sqlalchemy] getting results uncidoe from mssql with pyodbc (where mssql encoding is windows-1255) using turbogears scoped DBSession

2012-08-31 Thread alonn
I'm working on windows 7, where can I find the stack trace? On Friday, August 31, 2012 4:53:15 PM UTC+3, Michael Bayer wrote: freetds or windows ? critical plus: stack trace? critical On Aug 31, 2012, at 9:28 AM, alonn wrote: thanks - I use pyodbc 2.1.11 with sqlalchemy 0.7.3

[sqlalchemy] getting results uncidoe from mssql with pyodbc (where mssql encoding is windows-1255) using turbogears scoped DBSession

2012-08-28 Thread alonn
some of my sqlalchemy 0.7.3 (with tubrogears 2.1.4) models work with a mssql 2005 db using pyodbc. (No can't change this, don't bother suggesting, this is an enterprise financial system, I can just read and write to certain tables there) the query returned are encoded windows-1255 instead of

[sqlalchemy] strange attributeerror module object has no attribute exc when using sqlalchemy from a mod_wsgi handle

2012-03-27 Thread alonn
this is what I got from tailing the mod_wsgi error stack: [Tue Mar 27 23:14:16 2012] [error] [client 127.0.0.1] from sqlalchemy import create_engine,String,Unicode,Integer, Column, func,distinct, desc [Tue Mar 27 23:14:16 2012] [error] [client 127.0.0.1] File

[sqlalchemy] using sqlalchemy with Google app engine

2012-02-08 Thread alonn
I'm trying to deploy an sqlalchemy+ bottle.py web app to google app engine. I saw they also have an sql like backend so I guess sqlalchemy could work with Gae but I'm not sure would It support sqlalchemy from the box? or how should I the application it if needed? I know this was asked before, but