[sqlalchemy] can't adapt error appearing with SA 0.5

2009-06-26 Thread ucs
I've been using 0.3 for a while and everything was peachy. Now I'm trying to update the framework, which has 0.5 as requirement. Besides the syntax change (which cost my many hours to rewrite all the code), I now get a can't adapt error every time there's a datetime value involved. Do I really

[sqlalchemy] Re: Dynamic making of the where clause

2009-06-26 Thread Ashish Bhatia
:( Is it possible ! On Jun 23, 3:32 pm, Ash ashishsinghbha...@gmail.com wrote: Hello, I am tryin to make the dynamic where clause using append_whereclause. But how i can do that,  For eg : I have a==b and c in (1,2,3,4) or d like %s So i made three sqlalchemy expression 1. a==b 2. c

[sqlalchemy] Concurrent updating of a field in the same row

2009-06-26 Thread Bram Avontuur
Hey, I'm using sqlalchemy-0.4.8 with mysql-5.0 on innodb tables. I'm having trouble updating 1 field in 1 row concurrently. The problem is that I can't seem to reliably update the fields. Simple example: Program 1: .. session.close() session.begin() u =

[sqlalchemy] Re: Dynamic making of the where clause

2009-06-26 Thread King Simon-NFHD78
On Jun 23, 3:32 pm, Ash ashishsinghbha...@gmail.com wrote: Hello, I am tryin to make the dynamic where clause using append_whereclause. But how i can do that,  For eg : I have a==b and c in (1,2,3,4) or d like %s So i made three sqlalchemy expression 1. a==b 2. c in

[sqlalchemy] Re: Dynamic making of the where clause

2009-06-26 Thread Ashish Bhatia
Thanks But i get input as [['a==b'],'and', [object of sqlalchemmy binary expression],'and','(', ['x==y'],'or',['t==y'],')'] for a==b and id in(1,2,3,4,5) and (x==y or t==y) Now from this ;list input i want to make the where expression. I tried making all to the string but the objects (binary

[sqlalchemy] Re: Commiting inserts made through Stored Procedure calls

2009-06-26 Thread Michael Bayer
Rodney Haynie wrote: I am having problems getting my data to save when the changes are made through stored procedures. I created a sample block of code below to show exactly how I am implementing this. code conn = DBSession.connection() statement = sql.text(CALL

[sqlalchemy] Re: can't adapt error appearing with SA 0.5

2009-06-26 Thread Michael Bayer
ucs wrote: I've been using 0.3 for a while and everything was peachy. Now I'm trying to update the framework, which has 0.5 as requirement. Besides the syntax change (which cost my many hours to rewrite all the code), I now get a can't adapt error every time there's a datetime value

[sqlalchemy] Re: Dynamic making of the where clause

2009-06-26 Thread Michael Bayer
Ashish Bhatia wrote: :( Is it possible ! On Jun 23, 3:32 pm, Ash ashishsinghbha...@gmail.com wrote: Hello, I am tryin to make the dynamic where clause using append_whereclause. But how i can do that,  For eg : I have a==b and c in (1,2,3,4) or d like %s So i made three sqlalchemy

[sqlalchemy] Re: Commiting inserts made through Stored Procedure calls

2009-06-26 Thread Rodney Haynie
Michael Bayer wrote: Rodney Haynie wrote: I am having problems getting my data to save when the changes are made through stored procedures. I created a sample block of code below to show exactly how I am implementing this. code conn = DBSession.connection() statement

[sqlalchemy] Re: introspecting models

2009-06-26 Thread phrrn...@googlemail.com
The MetaData object has a sorted_tables method/property that returns a list of Table objects. Also, MetaData.tables[] can be accessed by table-name (fully qualified including schema, if any). Table.columns has name and type information. Assuming a MetaData instance md, here is how you would list

[sqlalchemy] Re: unit testing idioms

2009-06-26 Thread phrrn...@googlemail.com
I am learning fixtures right now to see if I can use it to successfully solve this problem. pjjH On Jun 24, 6:11 pm, Chris Withers ch...@simplistix.co.uk wrote: Hi All, I'm wondering what the common idiom is for unit testing w.r.t. data and transactions... So, coming from my ZODB

[sqlalchemy] Re: Commiting inserts made through Stored Procedure calls

2009-06-26 Thread Michael Bayer
Rodney Haynie wrote: Michael Bayer wrote: Rodney Haynie wrote: I am having problems getting my data to save when the changes are made through stored procedures. I created a sample block of code below to show exactly how I am implementing this. code conn =

[sqlalchemy] Re: Commiting inserts made through Stored Procedure calls

2009-06-26 Thread Rodney Haynie
Michael Bayer wrote: Rodney Haynie wrote: Michael Bayer wrote: Rodney Haynie wrote: I am having problems getting my data to save when the changes are made through stored procedures. I created a sample block of code below to show exactly how I am implementing this.

[sqlalchemy] 'both of the same direction' relation error appears when upgrading from 0.5.2 to 0.5.4p2

2009-06-26 Thread Matthieu Imbert
Hi, I have data model with joined table inheritance + relations between classes of this joined table inheritance class hierarchy. This works well with sqlalchemy 0.5.2, but when upgrading to 0.5.4p2, i get the following exception: sqlalchemy.exc.ArgumentError: Entity.creator and back-reference

[sqlalchemy] SqlAlchemy limiting returned rows prematurely

2009-06-26 Thread Mike Driscoll
Hi, I am having an issue with what is getting returned from my SA query. Here's my code: code beginDate = 1/1/2007 endDate = 12/31/2007 qry = session.query(CheckHistory.CHK_DOC_NO, CheckHistory.EMP_ID, CheckHistory.CHECK_DATE,

[sqlalchemy] Re: SqlAlchemy limiting returned rows prematurely

2009-06-26 Thread Michael Bayer
Mike Driscoll wrote: Hi, I am having an issue with what is getting returned from my SA query. Here's my code: code beginDate = 1/1/2007 endDate = 12/31/2007 qry = session.query(CheckHistory.CHK_DOC_NO, CheckHistory.EMP_ID,

[sqlalchemy] Re: 'both of the same direction' relation error appears when upgrading from 0.5.2 to 0.5.4p2

2009-06-26 Thread Michael Bayer
Matthieu Imbert wrote: Hi, sqlalchemy.exc.ArgumentError: Entity.creator and back-reference Client.entities_created are both of the same direction symbol 'ONETOMANY. Did you mean to set remote_side on the many-to-one side? relation(Client,

[sqlalchemy] Re: Commiting inserts made through Stored Procedure calls

2009-06-26 Thread Michael Bayer
Rodney Haynie wrote: Ok, tried it. Still no data being committed. No errors popping either. its likely a turbogears usage issue so check with their list. I know they have their own idea about transactional scope. --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: Problems with sub-queries

2009-06-26 Thread Michael Bayer
Mike wrote: TypeError: 'Alias' object is unindexable that error means you're trying to say x['foo'] on something that doesn't have a __getitem__(). I don't see that here, can you send a stack trace which would reveal if this is being produced from within SQLAlchemy internals ?

[sqlalchemy] joined table inheritance, association object between base class

2009-06-26 Thread Sp
-Base entity is Party, which has sub-types Person and Organization. -Using joined table inheritance, with base table 'parties', and sub- tables 'people' and 'organizations' -Want to create association class to capture various types of relationships between parties. Let's say this association