[sqlalchemy] Retrieving attribute values after error rollback without querying

2011-05-31 Thread chris e
I have a field verification routine that is run as part of a mapper extension. When a field error is detected, an exception is thrown with the field in question, the object with the incorrect field. This worked great in 0.3, but I'm now moving to 0.6, and I can no longer do this as my invalid

[sqlalchemy] Custom UTC DateTime Type with Custom insert functionality

2011-02-08 Thread chris e
To simplify date handling in a project on which I am working, I am storing UTC dates in the database in a timestamp with timezone field, however, because cx_Oracle does not have any timezone functionality, I need to cast the UTC timestamp I'm inserting into the database as a timestamp in UTC so

[sqlalchemy] Re: Custom UTC DateTime Type with Custom insert functionality

2011-02-08 Thread chris e
) return value class utc_timestamp(FunctionElement): type = DateTime() @compiles(utc_timestamp) def _oracle_utc_timestamp(element, compiler, **kw): import pdb pdb.set_trace() On Feb 8, 6:09 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 8, 2011, at 4:56 PM, chris e wrote

[sqlalchemy] Re: Custom UTC DateTime Type with Custom insert functionality

2011-02-08 Thread chris e
no value given, no bind params used. On Feb 8, 2011, at 10:13 PM, chris e wrote: I now have the code below, but the _oracle_utc_timestamp function is never called, even when I do explicitly set a value. class UTCTimestamp(TypeDecorator):    impl = TIMESTAMP    # add the UTC time zone

[sqlalchemy] Get list of items to be flushed in session extension

2010-05-04 Thread chris e
I'm trying to provide functionality in a session extension for an class to provide a 'before_flush' method that allows the class to make changes to the session, and add additional items. To do this I need to get the list of instances to be flushed to the database, and the order in which

[sqlalchemy] Re: Get list of items to be flushed in session extension

2010-05-04 Thread chris e
the items to be flushed in the order in which they are being flushed, even though this may be an expensive operation. On May 4, 4:17 pm, Michael Bayer mike...@zzzcomputing.com wrote: On May 4, 2010, at 5:23 PM, chris e wrote: I'm trying to provide functionality in a session extension

[sqlalchemy] Re: Calling a function after every new connection is created

2010-03-18 Thread chris e
Thanks, that's perfect. I knew it had to be in the API somewhere, but I couldn't find it. On Mar 18, 5:44 am, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 17, 2010, at 9:45 PM, chris e wrote: Because of the way that we have our Oracle database setup, I have to do the following

[sqlalchemy] AttributeError: 'cx_Oracle.LOB' object has no attribute 'decode'

2010-03-18 Thread chris e
I am running into the following error running under mod_wsgi, and against an Oracle Database, using cx_Oracle I'm running the following query: result = select([TABLES.SYSTEM_CONFIG.c.value], TABLES.SYSTEM_CONFIG.c.key=='email_address').execute().fetchall() The table is defined as follows:

[sqlalchemy] Re: how to change a database

2009-12-04 Thread chris e
As far as the creation I'm no help, but I have done something similar by connecting to different schemas in oracle. By setting the schema argument on your table objects, you can bind them to a particular database(schema), by changing the value of the schema argument, you can switch from one

[sqlalchemy] Re: potential oracle character column reflection bug?

2009-08-27 Thread chris e
, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 26, 2009, at 8:53 PM, chris e wrote: I just checked the trunk, it the same reflection code is in place, as far as the column length is concerned. To me the question is, should sqlalchemy be aware of Char vs Byte storage

[sqlalchemy] potential oracle character column reflection bug?

2009-08-26 Thread chris e
I noticed that with reflection, my column lengths seems to be incorrect for varchar2, and char columns that are using char storage instead of byte storage. I.E. a VARCHAR2(400 CHAR) colum, is reported to have a length of 1600 by sqlalchemy, as our database uses utf-32 for storage, however, there

[sqlalchemy] Re: potential oracle character column reflection bug?

2009-08-26 Thread chris e
of characters? I'm not 100% sure. Anyone else out there using oracle, and have an opinion. On Aug 26, 5:37 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 26, 2009, at 6:56 PM, chris e wrote: I noticed that with reflection, my column lengths seems to be incorrect for varchar2

[sqlalchemy] Re: potential oracle character column reflection bug?

2009-08-26 Thread chris e
 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 26, 2009, at 8:53 PM, chris e wrote: I just checked the trunk, it the same reflection code is in place, as far as the column length is concerned. To me the question is, should sqlalchemy be aware of Char vs Byte storage

[sqlalchemy] _dependency_processor Attribute Error Bug in orm.dependency with viewonly many to many relationships

2009-08-17 Thread chris e
I'm not sure if this affects S.A 0.6. It appears that orm.properties.RelationProperty. _post_init does not create a _dependency_processor attribute if the relation is viewonly. Line1016: if not self.viewonly: self._dependency_processor =

[sqlalchemy] Re: _dependency_processor Attribute Error Bug in orm.dependency with viewonly many to many relationships

2009-08-17 Thread chris e
Ticket created: #1507 Chris On Aug 17, 12:49 pm, Philip Jenvey pjen...@underboss.org wrote: On Aug 17, 2009, at 12:01 PM, chris e wrote: I'm not sure if this affects S.A 0.6. It appears that orm.properties.RelationProperty. _post_init does not create a _dependency_processor

[sqlalchemy] Unit Of work seems to be calling save/delete twice

2007-04-17 Thread chris e
I'm not sure why. But when I do a delete/sql alchemy seems to be running the save/delete operation twice. Could this be related to a circular dependency in UOW that is undetected?? When deleting this is causing the following error because the database delete is done twice:

[sqlalchemy] deferred join against details table in polymorphic union for performance

2007-03-26 Thread chris e
Currently when sqlalchemy performs a polymorphic lookup, it queries against all the detail tables, and returns the correct Python object represented by the polymorphic identity. Essentially you get a sub select for each detail table that is included in your primary join even though only one of

[sqlalchemy] Re: Column and business object verification??

2007-01-29 Thread chris e
On Jan 29, 1:49 am, Julien Cigar [EMAIL PROTECTED] wrote: Michael Bayer wrote: On Jan 24, 1:50 am, chris e [EMAIL PROTECTED] wrote: I am planning on using sqlalchemy to build the api for a database I am developing, and I was wondering if there is any type of column verification

[sqlalchemy] Column and business object verification??

2007-01-28 Thread chris e
I am planning on using sqlalchemy to build the api for a database I am developing, and I was wondering if there is any type of column verification that occurs before database commit. I.E.: a string column with length 40 would throw a verification exception if a value longer that 40 characters