[sqlalchemy] Re: py32 TypeError: unorderable types: str() int()

2011-07-22 Thread ddarko
To reproduce the error is needed: Python 3.2.0 SqlAlchemy 0.7.1 I use PostgreSQL 8.4 + psycopg2 2.4.2 but I think it does not matter. Contents of the table in the database before running the script. This is important. test2=# SELECT * from fl_opts ; key | value -+--- b | 3 (1 row)

[sqlalchemy] Re: py32 TypeError: unorderable types: str() int()

2011-07-22 Thread ddarko
THX On Jul 22, 4:13 pm, Michael Bayer mike...@zzzcomputing.com wrote: thanks.  this is ticket #2228, issue is only in Python 3 if you want to stay on 2 for now, patch is attached in the meantime before the ticket is fixed.  2228.patch 1KViewDownload On Jul 22, 2011, at 9:19 AM, ddarko

[sqlalchemy] py32 TypeError: unorderable types: str() int()

2011-07-20 Thread ddarko
declarative_base tmp = session.query(Opt).all() session.add(Opt(key='a', value='b')) session.commit() File /usr/local/lib/python3.2/dist-packages/SQLAlchemy-0.7.1- py3.2.egg/sqlalchemy/orm/session.py, line 617, in commit self.transaction.commit() File

[sqlalchemy] Re: py32 TypeError: unorderable types: str() int()

2011-07-20 Thread ddarko
with two fields and commit it, no such error occurs.   There is some suggestion of inappropriate assignment of a string or int to an attribute which expects the opposite here. On Jul 20, 2011, at 1:26 PM, ddarko wrote: declarative_base tmp = session.query(Opt).all() session.add(Opt

[sqlalchemy] default value from column

2011-07-13 Thread ddarko
class AccountHistory(Base): id = sa.Column(sa.types.Integer, primary_key=1) date= sa.Column(sa.types.DateTime, nullable=0, default=sa.func.current_timestamp()) type= sa.Column(sa.types.Integer, nullable=0,

[sqlalchemy] Re: Sqlalchemy declarative_base()

2011-07-13 Thread ddarko
On Jul 12, 5:40 pm, Dipo Elegbede dipo.elegb...@gmail.com wrote: Can I create two tables under a single Base class. Yes. If Base is the Base class then: class Tab1(Base): name = Column(String) extension = Column(String) class Tab2(Base): name = Column(String) extension =

[sqlalchemy] Re: Sqlalchemy declarative_base()

2011-07-13 Thread ddarko
On Jul 12, 5:40 pm, Dipo Elegbede dipo.elegb...@gmail.com wrote: I would appreciate if you point me to any relevant documentation. http://www.sqlalchemy.org/docs/orm/extensions/declarative.html?highlight=declarative_base -- You received this message because you are subscribed to the Google

[sqlalchemy] Re: default value from column

2011-07-13 Thread ddarko
are talking about the integer column, all defaults have to be a string or some SQLAlchemy function so you'd want: type = sa.Column(sa.types.Integer, nullable=0, default='1') On Wed, Jul 13, 2011 at 7:37 AM, ddarko ddarko...@gmail.com wrote: class AccountHistory(Base):    id

[sqlalchemy] Re: default value from column

2011-07-13 Thread ddarko
On Jul 13, 3:47 pm, Mike Conley mconl...@gmail.com wrote: given Column('status', String(1), default='A') try         table.status.c.default.arg AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object has an attribute 'c' I'm using the Declarative ORM Extension. It

[sqlalchemy] Re: default value from column

2011-07-13 Thread ddarko
I did it this way: class AccountHistory(Base): id = sa.Column(sa.types.Integer, primary_key=1) date = sa.Column(sa.types.DateTime, nullable=0, default=sa.func.current_timestamp()) type = sa.Column(sa.types.Integer, nullable=0, default=1) def getdefault(self, name):

[sqlalchemy] sqlalchemy 0.7.1 pgarray

2011-07-06 Thread ddarko
t = Session.query(Tests).get(1) print(t.array) t.array.append(1) Session.commit() t.array - is an int. array in postgresql This simple construction does not change the content of the list after commit, and it seems to me that it should. Of course t.array = t.array + [1] works correctly. -- You

[sqlalchemy] Re: sqlalchemy 0.7.1 pgarray

2011-07-06 Thread ddarko
psycopg2 2.4.1 python 3.2.0 -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options,

[sqlalchemy] Re: sqlalchemy 0.7.1 pgarray

2011-07-06 Thread ddarko
THX On Jul 6, 4:09 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 6, 2011, at 10:03 AM, ddarko wrote: t = Session.query(Tests).get(1) print(t.array) t.array.append(1) Session.commit() t.array - is an int. array in postgresql This simple construction does not change

[sqlalchemy] Re: Multi-Processing Environment

2011-06-02 Thread ddarko
...@zzzcomputing.com wrote: On May 28, 2011, at 4:25 AM, ddarko wrote: http://lists.unbit.it/pipermail/uwsgi/2011-May/002078.html: ...Unfortunately, when running our app in uWSGI with more than one worker, we get sporadic, but frequent, sqlalchemy-related exceptions when testing

[sqlalchemy] Multi-Processing Environment

2011-05-28 Thread ddarko
http://lists.unbit.it/pipermail/uwsgi/2011-May/002078.html : ...Unfortunately, when running our app in uWSGI with more than one worker, we get sporadic, but frequent, sqlalchemy-related exceptions when testing under load. Following is an example of one of the more common errors we get. Error -

[sqlalchemy] Python 3.1 + SQLAlchemy 0.6 or 0.7

2011-03-21 Thread ddarko
Python 3.1 SQLAlchemy 0.6.6 (and tested with 0.7b3) psycopg2 2.4 postgresql 8.4 Has anyone tested this configuration? psycopg2 alone work for me great, but in spite of installing the current version of SQLAlchemy accordance with the instructions README.py3k connection is not working properly:

[sqlalchemy] Re: Python 3.1 + SQLAlchemy 0.6 or 0.7

2011-03-21 Thread ddarko
AM, ddarko wrote: Python 3.1 SQLAlchemy 0.6.6  (and tested with 0.7b3) psycopg2 2.4 postgresql 8.4 Has anyone tested this configuration? psycopg2 alone work for me great, but in spite of installing the current version of SQLAlchemy accordance with the instructions

[sqlalchemy] Re: SQLAlchemy-0.6.3-py2.6 postgresql+pg8000

2010-09-02 Thread ddarko
thanks for the advice. for the curious: the problem is in reading few rows pgARRAY. Table company Column |Type | Modifiers phone | character varying(150)[]| not null ... from pg8000 import DBAPI conn = DBAPI.connect(host=localhost, user=x,

[sqlalchemy] SQLAlchemy-0.6.3-py2.6 postgresql+pg8000

2010-08-29 Thread ddarko
print session.query(session.Company).all() File /usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.6.3-py2.6- linux-x86_64.egg/sqlalchemy/orm/query.py, line 1453, in all return list(self) File /usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.6.3-py2.6-

[sqlalchemy] Re: SQLAlchemy-0.6.3-py2.6 postgresql+pg8000

2010-08-29 Thread ddarko
Full Traceback (most recent call last): File /usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.6.3-py2.6- linux-x86_64.egg/sqlalchemy/orm/query.py, line 1453, in all return list(self) File /usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.6.3-py2.6-