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)
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
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
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
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,
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 =
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
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
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
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):
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
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,
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
...@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
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 -
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:
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
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,
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-
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-
20 matches
Mail list logo