[sqlalchemy] Re: Integrating the ORM with Trellis

2008-03-06 Thread jason kirtland

Michael Bayer wrote:
 
 On Feb 27, 2008, at 12:19 PM, jason kirtland wrote:
 
 Michael Bayer wrote:
 You also get a hook that receives the
 collection_class argument in the case of a collection-based attribute
 and you get to return your own class, in which case all the
 collections API stuff can kick in on that side.
 This can be opened up a bit to allow custom collection event systems  
 as
 well.  We'd move the

   'collections._prepare_instrumentation(typecallable)'

 out of the Attribute and into SA's default implementation of
 'instrument_collection_class'. If custom extenders want SA
 instrumentation, they can call that themselves.  The
 _prepare_instrumentation itself can become a public function, it's  
 stable.

 go for it

Ok, that's in.  At the extreme end, collections can route events to 
anything that quacks like a CollectionAdapter.  The moderate path is to 
make the collection's events compatible with the built-in 
CollectionAdapter.  And of course the easy path is to just use the 
existing collections instrumentation toolkit, it's already plenty flexible.

The sample script has an example of the extreme route, and the moderate 
is in test/.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: exception message encoded in utf8

2008-03-06 Thread Michael Bayer


On Mar 6, 2008, at 6:35 PM, jean-philippe dutreve wrote:


 Hi all,

 I use SQLAlchemy-0.4.2p3, postgreSQL 8.2.4 (UTF8 configured) and
 psycopg2.
 I have no issue with unicode DATA in and out of the database.

 My problem is that when an IntegrityError is thrown, the exception
 message is a string encoded in utf8.
 And the logging module throws an UnicodeDecodeError.

 Is there a way that the exception message is type of unicode instead
 of string?


logging module itself throws UnicodeDecodeError ?  are you sending  
exception messages using logging.debug() or similar ?  my impression  
is that you'd want to decode those manually doing something like  
string.decode('utf-8'). 
  

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---