[sqlalchemy] Re: column_property() caching

2007-12-04 Thread Marco Mariani
Vladimir Iliev wrote: hi, is it possible to add a non-caching column_property() to my mapping? You can use expire() on a single column, so you could proxy that column with a @property that also expires it. -- This e-mail (and any attachment(s)) is strictly confidential and for use only

[sqlalchemy] column_property() caching

2007-12-04 Thread Vladimir Iliev
hi, is it possible to add a non-caching column_property() to my mapping? --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: column_property() caching

2007-12-04 Thread Michael Bayer
the easiest way to do this would be to issue the SQL yourself...below uses the object_session() and object_mapper() functions to ensure that the current connection, if any, is used (you could also just say myengine.execute() if that didnt matter): class MyClass(object): @property def

[sqlalchemy] orm overrides explicit value sets

2007-12-04 Thread Kapil Thangavelu
i've attached an example, where a class constructor setups a default value on a relation field, in the constructor, the app code latter explicitly sets the fk attribute on the class, but sa ignores this value, and in the flushing process sets it be the value of the orm field, so that it

[sqlalchemy] problem with cast in postgres

2007-12-04 Thread Glauco
Hi all, i'm using the funct.cast in postgreSQL, but i thing the correct dialect is not used This is an example: valore is a text field. Scheda.select( tbl['scheda'].c.valore == '753' ) SELECT scheda.id_precedente AS scheda_id_precedente, scheda.stato_record AS scheda_stato_record,

[sqlalchemy] Re: problem with cast in postgres

2007-12-04 Thread Michael Bayer
CAST is its own contstruct: Scheda.select( cast( tbl['scheda'].c.valore, 'int') == '753' ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: problem with cast in postgres

2007-12-04 Thread Glauco
Michael Bayer ha scritto: CAST is its own contstruct: Scheda.select( cast( tbl['scheda'].c.valore, 'int') == '753' ) what doses it means? ahhh ops ! i've get cast from sqlalchemy.funct instead of sqlalchemy.sql anyway 'int' cannot work this is the proper use. Scheda.select(

[sqlalchemy] Re: orm overrides explicit value sets

2007-12-04 Thread Michael Bayer
On Dec 4, 2007, at 12:34 PM, Kapil Thangavelu wrote: i've attached an example, where a class constructor setups a default value on a relation field, in the constructor, the app code latter explicitly sets the fk attribute on the class, but sa ignores this value, and in the flushing

[sqlalchemy] Representation of boolean logic in a database

2007-12-04 Thread Alexandre Conrad
hi, this is more a database design question than a SA one. I have 2 tables, clients and options. A client can subscribe to multiple options, and options can be subscribed by multiple clients (many-to-many). Of course, we have a weak table for the many-to-many relationship. Then we have a

[sqlalchemy] should a dns error return true in dialect.is_disconnect() ?

2007-12-04 Thread David Bonner
Hi, I've run into a problem running SA 0.4.0 on top of psycopg2. We had a DNS hiccup, and the next attempt to execute a query triggered a ProgrammingError. Unfortunately, it seems that error didn't also invalidate the (implicit) connection, which was then returned to the pool. Successive

[sqlalchemy] Re: should a dns error return true in dialect.is_disconnect() ?

2007-12-04 Thread Michael Bayer
On Dec 4, 2007, at 3:26 PM, David Bonner wrote: Hi, I've run into a problem running SA 0.4.0 on top of psycopg2. We had a DNS hiccup, and the next attempt to execute a query triggered a ProgrammingError. Unfortunately, it seems that error didn't also invalidate the (implicit) connection,

[sqlalchemy] Collection class using OrderedDict and MappedCollection

2007-12-04 Thread Ronald Lew
I am creating a Collection class using the OrderedDict and MappedCollection with primary key id as the key index. The problem, as noted in the docs, is that the key should be an immutable field. Since I am using a primary key, the value will change when I am instantiating a new object and adding

[sqlalchemy] Re: should a dns error return true in dialect.is_disconnect() ?

2007-12-04 Thread David Bonner
On Dec 4, 4:32 pm, Michael Bayer [EMAIL PROTECTED] wrote: if the error message isnt caught by is_disconnect(), then yes the specific error message should be installed in there. But also note that psycopg2 has some specific issues with disconnects, namely that the exception is not always

[sqlalchemy] Re: should a dns error return true in dialect.is_disconnect() ?

2007-12-04 Thread Michael Bayer
On Dec 4, 2007, at 5:39 PM, David Bonner wrote: yeah, the more i think about it, the more i realize this is an error when the dbapi connection is created, it's not a disconnect condition. the original error message is No route to host, which I'm pretty sure is EHOSTUNREACH, which you get

[sqlalchemy] Re: should a dns error return true in dialect.is_disconnect() ?

2007-12-04 Thread Michael Bayer
ah, seems to be OK using python 2.5 and psycopg2.0.6, so, i guess thats fixed somehow On Dec 4, 2007, at 5:59 PM, Michael Bayer wrote: On Dec 4, 2007, at 5:39 PM, David Bonner wrote: yeah, the more i think about it, the more i realize this is an error when the dbapi connection is

[sqlalchemy] migration deprecation?

2007-12-04 Thread alex bodnaru
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi friends, i was using the table.c.keys() to enumerate the fields of a table. what would be the 0.4 way to do it? thanks in advance, alex -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla -