[sqlalchemy] Re: save_or_update and composit Primary Keys... MSSQL / pyodbc issue ?

2007-12-18 Thread Rick Morrison
Same here on pymssql. I tried it with 'start' as the only PK, and with both 'identifier' and 'start' as PK. Both work fine. Are you sure your in-database tabledef matches your declared schema? I've attached a script that works here. This one has both 'identifier' and 'start' set as PK. ***---

[sqlalchemy] Re: save_or_update and composit Primary Keys... MSSQL / pyodbc issue ?

2007-12-18 Thread Michael Bayer
On Dec 18, 2007, at 6:44 PM, Smoke wrote: > > Sorry because i'm a bit late ( work deadlines are struggling my > time! :) ). > I've made some different configurations and schema definitions... and > i've noticed that it never updates a row if i set the datetime field > as PK ( never! even if i s

[sqlalchemy] Re: save_or_update and composit Primary Keys... MSSQL / pyodbc issue ?

2007-12-18 Thread Smoke
Sorry because i'm a bit late ( work deadlines are struggling my time! :) ). I've made some different configurations and schema definitions... and i've noticed that it never updates a row if i set the datetime field as PK ( never! even if i set it as the only PK .. ). If i set composite PKs exclud

[sqlalchemy] Re: save_or_update and composit Primary Keys... MSSQL / pyodbc issue ?

2007-12-18 Thread Smoke
Sorry because i'm a bit late ( work deadlines are struggling my time! :) ). I've made some different configurations and schema definitions... and i've noticed that it never updates a row if i set the datetime field as PK ( never! even if i set it as the only PK .. ). If i set composite PKs exclud

[sqlalchemy] Re: Firebird status and some testsuite issues

2007-12-18 Thread jason kirtland
Lele Gaifax wrote: > Hi all, > > I was finally able to spend a little time on the Firebird backend, and > I'm glad to say that I'm currently down to this test summary: > [...] > C. a few tests don't use an explicit ordering, and assume that the > result of a select without an "ORDER BY" mat

[sqlalchemy] Re: Querying for Date column value

2007-12-18 Thread Justin
I should probably add that I'm curious if this is the desired behavior. From my (relatively inexperienced) point of view it seems that sqlalchemy should try to return whatever the programmer is expecting as designated by the column type. - Justin On Dec 18, 2:03 pm, Justin <[EMAIL PROTECTED]> wr

[sqlalchemy] Re: Fwd: [elixir] warnings on exit

2007-12-18 Thread Ryszard Szopa
On Dec 17, 5:46 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > Make sure you are closing all sessions that are created. Also, its > important that you show us what the exact warnings youre getting > are. Please send along a reproducing test case illustrating the full > issue. I am sorry to

[sqlalchemy] Re: Missing Sequences

2007-12-18 Thread Jonathan Gardner
On Dec 18, 10:39 am, Michael Bayer <[EMAIL PROTECTED]> wrote: > if you can produce decent code, and almost more importantly good unit > tests that ensure the decent code always works (else it might as well > be broken), commit access is there for the taking. Start with trac > tickets, i.e. create

[sqlalchemy] Re: Querying for Date column value

2007-12-18 Thread Justin
Sorry, Database is sqlite. From my understanding sqlite would store the value as a string. >From running the following test it seems that the orignal type of value stored (datetime vs date) is being maintained in sqlite regardless of the Column type: import datetime from sqlalchemy import * fr

[sqlalchemy] Re: Missing Sequences

2007-12-18 Thread Michael Bayer
On Dec 18, 2007, at 10:42 AM, Jonathan Gardner wrote: > > Shouldn't SQLAlchemy throw an exception when you try to grab the next > value of a non-existant sequence? for a database which supports sequences, it will. It appears that for DB's which don't, executing a sequence explicitly is silen

[sqlalchemy] Re: Querying for Date column value

2007-12-18 Thread Michael Bayer
not sure, it depends on what kind of database youre using (and what DBAPI) as well as the actual type of column is is on the database side. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post

[sqlalchemy] Querying for Date column value

2007-12-18 Thread Justin
I have a table with a Date column. Why does a python datetime match the value and a python date does not? For example: # example table institutions_table = Table('institutions', meta, Column('id', Integer, primary_key=True), Column('report_date', Date), ... this works: session.query

[sqlalchemy] Missing Sequences

2007-12-18 Thread Jonathan Gardner
I don't know what the design decisions were regarding the Sequence object, so bear with my ignorance for a moment here. I played with SQLAlchemy in conjunction with Pylons. I had code that looked like this: links_table = Table('links', metadata, Column('id', types.Numeric(), schema.Sequenc

[sqlalchemy] Re: how to unit test with SQ

2007-12-18 Thread Paulino
Hello! I have a similar error with SA 4.1.0 and turbogears. session.query(Extrato).filter_by(bank='IF5', data=datetime.datetime.strptime('2007/07/27','%Y/%m/%d')) File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.1-py2.5.egg/ sqlalchemy/orm/session.py", line 654, in query q = self._que

[sqlalchemy] Re: how to unit test with SQ

2007-12-18 Thread Paulino
Hello! I have a similar error with SA 4.1.0 and turbogears. session.query(Extrato).filter_by(bank='IF5', data=datetime.datetime.strptime('2007/07/27','%Y/%m/%d')) File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.1-py2.5.egg/ sqlalchemy/orm/session.py", line 654, in query q = self._que

[sqlalchemy] Re: Group_by 0.4 sytax

2007-12-18 Thread voltron
Thanks! I'll try that out Mike On Dec 18, 3:55 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Dec 18, 2007, at 9:49 AM, voltron wrote: > > > > > I am trying to retrieve unique users from a table using this: > > > results = sa_session.query(TempScore).group_by(TempScore.user_name) > > > This un

[sqlalchemy] Querying and retrieving the position of a result

2007-12-18 Thread voltron
I have numerical values assigned to user in a table, I have query the table, sort the table in a descending order and then return the value of a certain user with his position/rank in the table.Could someone give me a "leg" up? Thanks --~--~-~--~~~---~--~~ You rec

[sqlalchemy] Re: Group_by 0.4 sytax

2007-12-18 Thread Michael Bayer
On Dec 18, 2007, at 9:49 AM, voltron wrote: > > I am trying to retrieve unique users from a table using this: > > results = sa_session.query(TempScore).group_by(TempScore.user_name) > > This unfortunately causes the error below: > > "There was a problem: (ProgrammingError) column "temp_scores.id

[sqlalchemy] Re: Minor documentation mistake related to Unicode?

2007-12-18 Thread Michael Bayer
On Dec 18, 2007, at 5:41 AM, Felix Schwarz wrote: > > Hi, > > http://www.sqlalchemy.org/docs/04/types.html says: >> The Unicode type is shorthand for String with convert_unicode=True >> and >> assert_unicode=True. > > But the constructor for String (types.py) says: >> def __init__(self, leng

[sqlalchemy] Re: chunks of blob data...

2007-12-18 Thread Michael Bayer
On Dec 18, 2007, at 4:30 AM, Chris Withers wrote: > > Hi All, > > I guess this question would also be applicable to the lists of the rdb > in question but since SA is going to have to help to I thought I'd ask > here... > > Okay, so if I have a table that contains a blob-ish field containing > s

[sqlalchemy] Group_by 0.4 sytax

2007-12-18 Thread voltron
I am trying to retrieve unique users from a table using this: results = sa_session.query(TempScore).group_by(TempScore.user_name) This unfortunately causes the error below: "There was a problem: (ProgrammingError) column "temp_scores.id" must appear in the GROUP BY clause or be used in an aggre

[sqlalchemy] Minor documentation mistake related to Unicode?

2007-12-18 Thread Felix Schwarz
Hi, http://www.sqlalchemy.org/docs/04/types.html says: > The Unicode type is shorthand for String with convert_unicode=True and > assert_unicode=True. But the constructor for String (types.py) says: >def __init__(self, length=None, convert_unicode=False): Using TEXT(assert_unicode=True)

[sqlalchemy] chunks of blob data...

2007-12-18 Thread Chris Withers
Hi All, I guess this question would also be applicable to the lists of the rdb in question but since SA is going to have to help to I thought I'd ask here... Okay, so if I have a table that contains a blob-ish field containing something like a 20Mb PDF per row (I'm not sure this is a good ide