[sqlalchemy] Re: Updating field by applying transformation function to current field value

2010-06-10 Thread bartomas
Many thanks. Great help. On Jun 9, 4:44 pm, Conor conor.edward.da...@gmail.com wrote: On 06/09/2010 07:58 AM, bartomas wrote: Hi, I'm new to SqlAlchemy. I'd like to find the simplest way of updating the fields of a table by applying a transformation function to the current value of

Re: [sqlalchemy] Some weir(for me) behavior of one-to-one relation.

2010-06-10 Thread bogun . dmitriy
I have 2 tables with one-to-one relation, and I got some unexpected behaviour from sqlalchemy. In attach there is demonstration script and its log. If I try to add object into table right for already existing key I expect error on DB level, telling about violation of unique constraint, but

[sqlalchemy] help please

2010-06-10 Thread Aref
Hello All, I just began learning sqlalchemy and am not quite used to it yet so please excuse my ignorance and which might be a trivial question to some of you. I am writing a database module and need to load a table and possibly modify a record in the table. I can get the connection established

[sqlalchemy] good IDE for SQLAlchemy and wxPython?

2010-06-10 Thread Carl Brewer
G'day, I'm developing my first desktop application with python and a database (to track cycling track sprinters, if anyone's interested, using sqlite at the moment, but anything lightweight is fine) - and have been poking around various IDE's and database layers that work with Python,

RE: [sqlalchemy] Sybase reports conversion from datatype 'CHAR' to 'INT' is not allowed. when using string instead of int for filterby

2010-06-10 Thread Cserna, Zsolt
SQLAlchemy doesn't do type coercion out of the box. Some DBAPIs do, which is why you may have not noticed this issue on other platforms. You can build that functionality yourself using TypeDecorator:

[sqlalchemy] Kerberos authentication with sybase

2010-06-10 Thread Cserna, Zsolt
Hi all, Is there any plan to add kerberos authentication to the sybase engine in sqlalchemy? I've implemented it but it's using the creator parameter of the create_engine function, which is ok, but in certain circumstances when the application using sqlalchemy uses configuration from a text

[sqlalchemy] Re: help please

2010-06-10 Thread GHZ
you should access column names via lower case i.e. columns = 'projectid', 'program', 'progmanger'] On 10 Jun, 03:39, Aref arefnamm...@gmail.com wrote: Hello All, I just began learning sqlalchemy and am not quite used to it yet so please excuse my ignorance and which might be a trivial

Re: [sqlalchemy] good IDE for SQLAlchemy and wxPython?

2010-06-10 Thread werner
Carl, On 10/06/2010 08:17, Carl Brewer wrote: G'day, I'm developing my first desktop application with python and a database (to track cycling track sprinters, if anyone's interested, using sqlite at the moment, but anything lightweight is fine) - and have been poking around various IDE's and

Re: [sqlalchemy] Having case problem with column name in postgresql

2010-06-10 Thread Michael Bayer
On Jun 10, 2010, at 12:06 AM, Mike Bernson wrote: I am trying to access a postgres database with mixed case column names. I am using reflection to get the table. Here is my connect string: 'postgresql://:mike@/cedar_senior_services' The error message: (ProgrammingError) column

Re: [sqlalchemy] Sybase reports conversion from datatype 'CHAR' to 'INT' is not allowed. when using string instead of int for filterby

2010-06-10 Thread Michael Bayer
On Jun 10, 2010, at 8:51 AM, Cserna, Zsolt wrote: SQLAlchemy doesn't do type coercion out of the box. Some DBAPIs do, which is why you may have not noticed this issue on other platforms. You can build that functionality yourself using TypeDecorator:

Re: [sqlalchemy] Kerberos authentication with sybase

2010-06-10 Thread Michael Bayer
if you want to show me how that's done with your DBAPI (what DBAPI is this?), sure, though if its something that you pass in via **kw to DBAPI.connect(), you can already do that by passing connect_args to create_engine(), or adding them onto the querystring db://...?foo=bar. On Jun 10, 2010,

[sqlalchemy] Re: help please

2010-06-10 Thread Aref
Thank you for the response. However, that is not the problem. If I do update = table.update(project.c.ProjectID=='project-name', values = {project.c.ProjectID:'program'}) print update update.execute() everything works fine. if I do this: test = 'table.c.'+columns[0] #columns is a list which

RE: [sqlalchemy] help please

2010-06-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Aref Sent: 10 June 2010 02:40 To: sqlalchemy Subject: [sqlalchemy] help please Hello All, I just began learning sqlalchemy and am not quite used to it yet so please excuse

Re: [sqlalchemy] Re: help please

2010-06-10 Thread Lance Edgar
On 6/10/2010 10:29 AM, Aref wrote: Thank you for the response. However, that is not the problem. If I do update = table.update(project.c.ProjectID=='project-name', values = {project.c.ProjectID:'program'}) print update update.execute() everything works fine. if I do this: test =

Re: [sqlalchemy] Having case problem with column name in postgresql

2010-06-10 Thread Mike Bernson
Michael Bayer wrote: On Jun 10, 2010, at 12:06 AM, Mike Bernson wrote: I am trying to access a postgres database with mixed case column names. I am using reflection to get the table. Here is my connect string: 'postgresql://:mike@/cedar_senior_services' The error message:

[sqlalchemy] Re: help please

2010-06-10 Thread Aref
Thank you very much. I'll try it. Is there a better way of doing this-- I mean there must be since this is necessary for any application needing to modify a database where generally tables are accessed dynamically. On Jun 10, 9:37 am, Lance Edgar lance.ed...@gmail.com wrote: On 6/10/2010 10:29

Re: [sqlalchemy] mssql 2000 Date type on sa 0.6 maps to non-existant DATE type

2010-06-10 Thread Clovis Fabricio
2010/6/9 Clovis Fabricio nos...@gmail.com: 2010/6/9 Michael Bayer mike...@zzzcomputing.com: I think I know what the problem is.  You need to use freetds version 7.0 or 8.0.  If I set mine down to 4.2, I get your goofy results. I'm away from the server right now, I'll do more tests tomorrow,

Re: [sqlalchemy] Re: help please

2010-06-10 Thread Lance Edgar
On 6/10/2010 11:22 AM, Aref wrote: Thank you very much. I'll try it. Is there a better way of doing this-- I mean there must be since this is necessary for any application needing to modify a database where generally tables are accessed dynamically. Well, I suspect the "better way"

[sqlalchemy] Re: Questions about session

2010-06-10 Thread Az
The pprintout was: {type 'collections.defaultdict': 156, type 'bool': 2, type 'float': 1, type 'int': 538, type 'list': 1130, type 'dict': 867, type 'NoneType': 1, type 'set': 932, type 'str': 577, type 'tuple': 1717, type 'type': 5, class 'sqlalchemy.util.symbol': 1, class

[sqlalchemy] Re: connection lost contact error for first database connection every morning

2010-06-10 Thread Kerrb
Thank you, we will try recycling every hour and see if tomorrow connects without a hitch. On Jun 9, 5:43 pm, Michael Bayer mike...@zzzcomputing.com wrote: since nobody is getting back to you on this one you want to look into pool_recycle

[sqlalchemy] Re: Questions about session

2010-06-10 Thread Az
So I laid them out like this: class Run(Base): # For autoincrementing run IDs # Allows addition of more information to a run __tablename__ = 'run' id = Column(Integer, primary_key=True) timestamp = Column(DateTime, nullable=False) # comment = Column(UnicodeText(100),

[sqlalchemy] mod_wsgi, SQLite3 and a threading anomaly because connection is not returned to pool by session.remove()

2010-06-10 Thread Vinay Sajip
I'm getting the SQLite objects created in a thread can only be used in that same thread. error when using a web application with mod_wsgi configured in daemon mode with processes=1, threads=15 on Ubuntu Karmic, using Python2.6. I saw another thread [1] which mentioned a similar issue, and I

Re: [sqlalchemy] help with 0.6 migration

2010-06-10 Thread Michael Bayer
thats very interesting. Would you care to share with us the error ? On Jun 10, 2010, at 1:08 PM, Alexander Zhabotinskiy wrote: I'v get an error with this construction with migrating to 0.6.1 sList = [] if len(curDeps) 0: for item in curDeps:

[sqlalchemy] Re: Questions about session

2010-06-10 Thread Az
Let me take a guess: class Supervisor(object): def __init__(self, ee_id, name, original_quota, loading_limit): self.ee_id = ee_id self.name = name self.original_quota = original_quota self.loading_limit = loading_limit

Re: [sqlalchemy] mod_wsgi, SQLite3 and a threading anomaly because connection is not returned to pool by session.remove()

2010-06-10 Thread Michael Bayer
On Jun 10, 2010, at 2:54 PM, Vinay Sajip wrote: I'm getting the SQLite objects created in a thread can only be used in that same thread. error when using a web application with mod_wsgi configured in daemon mode with processes=1, threads=15 on Ubuntu Karmic, using Python2.6. When a GET