[sqlalchemy] Re: PostgreSQL - fetching boolean type gives integer type

2006-12-22 Thread Alan Franzoni
in sanjay's example, its inserting an integer 1 or 0 value, not True. I think that's the problem. He's saying: What happens is, while fetching, boolean columns are fetched as integer type (0, 1). He's trying to set the show_ads column from the value of another column (directly pulled from

[sqlalchemy] Re: PostgreSQL - fetching boolean type gives integer type

2006-12-22 Thread Sanjay
My system was having PostgreSQL 8.1.4 and psycopg. After Alan's code failing in my system, I doubted on psycopg. With some struggle, I successfully installed psycopg2 and removed psycopg, and things worked! Thanks a lot for the diagnosis, guys. Extremely sorry to have bothered you.

[sqlalchemy] Re: PostgreSQL - fetching boolean type gives integer type

2006-12-22 Thread Alan Franzoni
My system was having PostgreSQL 8.1.4 and psycopg. After Alan's code failing in my system, I doubted on psycopg. With some struggle, I successfully installed psycopg2 and removed psycopg, and things worked! You'll find really comfortable with psycopg2. I, too, used psycopg1 till August 2006

[sqlalchemy] table_foo.c.column_foo.autoincrement returning True always

2006-12-22 Thread Sanjay
In order to know whether a column is an autoincrement column, I am checking the above flag. But it is returning True always, irrespective of the column. I am using SQLAlchemy 0.3.3, PostgreSQL 8.1.4 and psycopg2 on fedora 5. Wondering whether it's the correct flag, anything is wrong in my

[sqlalchemy] Re: table_foo.c.column_foo.autoincrement returning True always

2006-12-22 Thread Alexandre CONRAD
Sanjay wrote: In order to know whether a column is an autoincrement column, I am checking the above flag. But it is returning True always, irrespective of the column. I am using SQLAlchemy 0.3.3, PostgreSQL 8.1.4 and psycopg2 on fedora 5. Here is a similar post that was replied:

[sqlalchemy] SessionTransaction behaviour

2006-12-22 Thread Alan Franzoni
Hello, I'm experiencing what I think is an unexpected behaviour using SessionTransaction in SA 0.3.3. The following example is a slightly modified one from SA's SessionTransaction docs. #begin sa_example.py sess = create_session() trans = sess.create_transaction() item1 =

[sqlalchemy] SqlSoup error

2006-12-22 Thread Sean Davis
I have the following three tables and trying to do a join. See below for details: g_main ( gene_id serial primary key, . ); g_refseq ( refseq varchar references refseq(refseq), gene_id int references g_main(gene_id) ); refseq ( refseq varchar primary key ); from

[sqlalchemy] Re: SqlSoup error

2006-12-22 Thread Alan Franzoni
Any suggestions on what I am missing? I don't use sqlsoup and I don't know whether you not using it correctly; btw, if you're in hurry, as a simple workaround, I suggest you add this line to sqlsoup.py, line 369, just above klass_query =... : klass._mapper.compile() and see if it works.

[sqlalchemy] Re: SessionTransaction behaviour

2006-12-22 Thread Michael Bayer
we dont rollback the attributes of objects nor do we automatically expunge() them. its impossible for SA to rollback in-memory objects without great danger of stepping on other program state that the user doesn't want affected.the rollback that is performed by SessionTransaction is a

[sqlalchemy] Re: SqlSoup error

2006-12-22 Thread Sean Davis
On Friday 22 December 2006 10:10, Alan Franzoni wrote: Any suggestions on what I am missing? I don't use sqlsoup and I don't know whether you not using it correctly; btw, if you're in hurry, as a simple workaround, I suggest you add this line to sqlsoup.py, line 369, just above klass_query

[sqlalchemy] Re: How to auto-set timestamp: MySQL func.now(), but not SQLite

2006-12-22 Thread Chris Shenton
Michael Bayer [EMAIL PROTECTED] writes: func.current_timestamp() (which evaulates without the parenthesis in SQL) Excellent, works like a charm. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: How to auto-set timestamp: MySQL func.now(), but not SQLite

2006-12-22 Thread Rick Morrison
FWIW, that works in MS-SQL and Postgres as well. One of the too-few functions that works cross-DBengine. On 12/22/06, Chris Shenton [EMAIL PROTECTED] wrote: Michael Bayer [EMAIL PROTECTED] writes: func.current_timestamp() (which evaulates without the parenthesis in SQL) Excellent, works

[sqlalchemy] Re: SqlSoup error

2006-12-22 Thread Michael Bayer
when i put PKs on the table, it worked fine. so that you get the error is disturbing to me since I have tried to insure that there are no paths into a Mapper that wont compile it first. It makes sense that you might have problems I dont, since im testing on OSX whereas you are on linux, and

[sqlalchemy] Re: table_foo.c.column_foo.autoincrement returning True always

2006-12-22 Thread Sanjay
I am not reflecting the tables. Example code: from sqlalchemy import * metadata = BoundMetaData('postgres://user:[EMAIL PROTECTED]/mydb', echo=True) company_tbl = Table('company', metadata, Column('company_id', Integer, primary_key=True, autoincrement=True), Column('name',