Re: [sqlalchemy] Re: integrity error in FK relation

2009-12-02 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-12-01, Wt o godzinie 21:58 -0800, rajasekhar911 pisze: but this happen only when i use innodb as engine. didnt give an error on myisam on mysql or sqlite. Probably because myisam is not transactional and sqlite usually doesn't care about constraints. Tomasz Jezierski Tefnet

[sqlalchemy] association_proxy question... I think

2009-12-02 Thread Sergey V.
Hi all, I've got two tables: Users (id, password) and UserProperties (user_id, name, value). Is there a way to map the properties stored in UserProperties as attributes of User object? I mean, john = User('john', 'password') john.name = John Smith # creates UserProperty('john', 'name', 'John

[sqlalchemy] many to many join condition

2009-12-02 Thread Petr Kobalíček
Hi devs, I have one problem related to join and adding conditions (sorry for misleading subject, I don't know how to describe it shortly). I have two tables: Product Tag There is many to many relation between tag and products and I need to select product where two tags are set. How to do

Re: [sqlalchemy] association_proxy question... I think

2009-12-02 Thread marten luter
See examples in sqlalchemy named dictlike.py und another 2 . here there are for example http://www.google.com/codesearch/p?hl=en#lIxjJFXSjns/trunk/code/prereq/SQLAlchemy-0.4.8/examples/vertical/dictlike.pyq=VerticalPropertyDictMixinsa=Ncd=1ct=rc On Wed, Dec 2, 2009 at 10:30 AM, Sergey V.

[sqlalchemy] Re: association_proxy question... I think

2009-12-02 Thread ent...@googlemail.com
Try this http://www.google.com/codesearch/p?hl=en#lIxjJFXSjns/trunk/code/prereq/SQLAlchemy-0.4.8/examples/vertical/dictlike.pyq=VerticalPropertyDictMixinsa=Ncd=1ct=rc On Dec 2, 10:30 am, Sergey V. sergey.volob...@gmail.com wrote: Hi all, I've got two tables: Users (id, password) and

Re: [sqlalchemy] easy_install SQLAlchemy

2009-12-02 Thread Alexandre Conrad
Hello, Problem figured out: I opened an issue on Distribute (the setuptools fork): http://bitbucket.org/tarek/distribute/issue/99/easy_install-uses-setupcfg-if-in-working Regards, Alex 2009/12/2 Alexandre Conrad alexandre.con...@gmail.com: Ok, I have my finger on the problem. From a

[sqlalchemy] Oracle timestamp and postgres datetime compatibility

2009-12-02 Thread drakkan
Hi all, I have a sa model working with postgres, here is a code fragment: class Test(Base): __tablename__ = 'test' fileld1= Column(Unicode(40), nullable=False, primary_key=True) date = Column(DateTime, nullable=False) in postgres the sqltypes.DateTime is converted in:

Re: [sqlalchemy] Oracle timestamp and postgres datetime compatibility

2009-12-02 Thread Michael Bayer
On Dec 2, 2009, at 8:48 AM, drakkan wrote: Hi all, I have a sa model working with postgres, here is a code fragment: class Test(Base): __tablename__ = 'test' fileld1= Column(Unicode(40), nullable=False, primary_key=True) date = Column(DateTime, nullable=False)

[sqlalchemy] extending sqlalchemy for low-level connection auditing

2009-12-02 Thread jsa
In my SQLAlchemy app, I want to generate a dedicated, low-level log output that will capture sql queries and parameters in a custom- defined format, as well as separate elapsed times for execute and fetch, and number of rows fetched. In addition I'd like identifiers for the session / connection

Re: [sqlalchemy] Oracle timestamp and postgres datetime compatibility

2009-12-02 Thread Ian Kelly
On Wed, Dec 2, 2009 at 3:25 PM, Michael Bayer mike...@zzzcomputing.com wrote: from the article:  Beware while the TO_CHAR function works with both datatypes, the TRUNC function will not work with a datatype of TIMESTAMP. This is a clear indication that the use of TIMESTAMP datatype should

Re: [sqlalchemy] extending sqlalchemy for low-level connection auditing

2009-12-02 Thread Michael Bayer
On Dec 2, 2009, at 5:32 PM, jsa wrote: In my SQLAlchemy app, I want to generate a dedicated, low-level log output that will capture sql queries and parameters in a custom- defined format, as well as separate elapsed times for execute and fetch, and number of rows fetched. In addition I'd

Re: [sqlalchemy] Oracle timestamp and postgres datetime compatibility

2009-12-02 Thread Michael Bayer
On Dec 2, 2009, at 5:49 PM, Ian Kelly wrote: On Wed, Dec 2, 2009 at 3:25 PM, Michael Bayer mike...@zzzcomputing.com wrote: from the article: Beware while the TO_CHAR function works with both datatypes, the TRUNC function will not work with a datatype of TIMESTAMP. This is a clear

[sqlalchemy] ConcurrentModificationError

2009-12-02 Thread Dave Paola
I'm getting this: ConcurrentModificationError: updated rowcount 0 does not match number of objects updated 1 when I try to commit a simple deletion. I'm using Sqlite locally but the error also occurs on a Postgres database in a live environment with only ONE user connected. I saw this post from

Re: [sqlalchemy] ConcurrentModificationError

2009-12-02 Thread Michael Bayer
On Dec 2, 2009, at 5:46 PM, Dave Paola wrote: I'm getting this: ConcurrentModificationError: updated rowcount 0 does not match number of objects updated 1 when I try to commit a simple deletion. I'm using Sqlite locally but the error also occurs on a Postgres database in a live

Re: [sqlalchemy] ConcurrentModificationError

2009-12-02 Thread Dave Paola
Indeed, I do have TaskTags mapped to it's own class. However, I never explicitly delete any TaskTag object, only create them. In any case, what would the preferred way to add a new tag to a task (a new entry in the association table)? I was using the ORM to just create a new instance of TaskTag

Re: [sqlalchemy] ConcurrentModificationError

2009-12-02 Thread Conor
Dave Paola wrote: Indeed, I do have TaskTags mapped to it's own class. However, I never explicitly delete any TaskTag object, only create them. In any case, what would the preferred way to add a new tag to a task (a new entry in the association table)? I was using the ORM to just create a