[sqlalchemy] array column as primary key

2010-01-13 Thread avdd
I want to map a table with a postgresql array as a primary key. PostgreSQL supports it, and everything works until the session wants to use the list returned from the query as an instance key. How can I intercept the row returned to wrap it in a tuple? I can't figure out translate_row! from

[sqlalchemy] Hi,I found a codec bug,and I write a patch.

2010-01-13 Thread 诚子
detial please see http://my.unix-center.net/~WeiZhicheng/2010/01/13/sqlalchemy-0-6-unicodedecodeerror-bug-patch/ -- my.unix-center.net/~WeiZhicheng -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to

Re: [sqlalchemy] tracking back from logged sql back to the python that caused it

2010-01-13 Thread Chris Withers
Michael Bayer wrote: Chris Withers wrote: Easiest way to trap it is to monkeypatch Session.rollback(), or whatever rollback you think you might be calling, with a def that calls pdb.set_trace() or dumps a stack trace using inspect(). Any chance of SA growing the ability to do the latter

Re: [sqlalchemy] Hi,I found a codec bug,and I write a patch.

2010-01-13 Thread Gaetan de Menten
On Wed, Jan 13, 2010 at 10:16, 诚子 zhicheng1...@gmail.com wrote: detial please see http://my.unix-center.net/~WeiZhicheng/2010/01/13/sqlalchemy-0-6-unicodedecodeerror-bug-patch/ Well, if I understand correctly, you would like a workaround for a bad truncate algorithm in mysql (which apparently

Re: [sqlalchemy] Hi,I found a codec bug,and I write a patch.

2010-01-13 Thread 诚子
yeah,maybe you are right, but I'm not professional in mysql I just use the SQLAlchemy default create the table and field the field is utf8_general_ci my problem like that import sqlalchemy sqlalchemy.__version__ '0.6beta1' from sqlalchemy import create_engine engine =

Re: [sqlalchemy] array column as primary key

2010-01-13 Thread Michael Bayer
avdd wrote: I want to map a table with a postgresql array as a primary key. PostgreSQL supports it, and everything works until the session wants to use the list returned from the query as an instance key. How can I intercept the row returned to wrap it in a tuple? I can't figure out

Re: [sqlalchemy] tracking back from logged sql back to the python that caused it

2010-01-13 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: Chris Withers wrote: Easiest way to trap it is to monkeypatch Session.rollback(), or whatever rollback you think you might be calling, with a def that calls pdb.set_trace() or dumps a stack trace using inspect(). Any chance of SA growing the ability

[sqlalchemy] Case statement troubles

2010-01-13 Thread aoeuhtns
Hello, I am relatively new to SQLAlchemy, and I am only really interested in the SQL Expression Language for now. I am having trouble creating case statements. SQLAlchemy version: 0.5.7 Python version: 2.6.2 Here is the error I am getting: type(mco) class 'sqlalchemy.schema.Table'

[sqlalchemy] Re: Case statement troubles

2010-01-13 Thread aoeuhtns
Oops! type(case) class 'sqlalchemy.schema.Table' I was looking at the case statement parameters, and ignoring what Python was *really* complaining about! I gave the case table a different name and now I am back on track. By the way, it's been a real pleasure learning SQLAlchemy given the

Re: [sqlalchemy] Hi,I found a codec bug,and I write a patch.

2010-01-13 Thread Ilia Kharin
If you use utf8 encoding in database you must set your character set in connection url e.g.: engine = create_engine('mysql://root:@localhost/dev?charset=utf8') ... name1 = '中文中文' name1 '\xe4\xb8\xad\xe6\x96\x87\xe4\xb8\xad\xe6\x96\x87' print name1 中文中文 ed_user = User(name1)

Re: [sqlalchemy] Hi,I found a codec bug,and I write a patch.

2010-01-13 Thread 诚子
thanks, You are right! 2010/1/14 Ilia Kharin aksc...@gmail.com If you use utf8 encoding in database you must set your character set in connection url e.g.: engine = create_engine('mysql://root:@localhost/dev?charset=utf8') ... name1 = '中文中文' name1

[sqlalchemy] Re: array column as primary key

2010-01-13 Thread avdd
Thanks! Works great. On Jan 14, 2:27 am, Michael Bayer mike...@zzzcomputing.com wrote: avdd wrote: I want to map a table with a postgresql array as a primary key. PostgreSQL supports it, and everything works until the session wants to use the list returned from the query as an instance

[sqlalchemy] Problem installing SQLAlchemy as a dependency??

2010-01-13 Thread Lynton Grice
Hi there, I am trying to package a small Python lib I have created that has an install dependency on SQLAlchemy. I have created my setup.py file with the install_requires install_requires=[ 'SQLAlchemy', ], But whenever I try install my Python lib on a machine without SQLAlchemy