thanks, I did some other fixes to types today including getting Unicode to work, and integrated this. added a new unittest in types.py for all styles of custom type objects.

On Feb 10, 2006, at 6:40 AM, Alastair Houghton wrote:

Hi all,

I just tried using TypeDecorator and it doesn't work because of a mistaken check in types.py (you just get an exception about self.extended not being defined, because adapt() was never called). Here's a patch.

Kind regards,

Alastair.

Index: lib/sqlalchemy/types.py
===================================================================
--- lib/sqlalchemy/types.py     (revision 926)
+++ lib/sqlalchemy/types.py     (working copy)
@@ -35,7 +35,9 @@
         typeobj = typeobj()
# if the type is not a base type, i.e. not from our module, or its Null,
     # we return the type as is
- if typeobj.__module__ != 'sqlalchemy.types' or typeobj.__class__==NullTypeEngine:
+    if ((typeobj.__module__ != 'sqlalchemy.types'
+         or typeobj.__class__==NullTypeEngine)
+        and not isinstance(typeobj, TypeDecorator)):
         return typeobj
     typeobj = typeobj.adapt_args()
     t = typeobj.__class__


--
http://www.alastairs-place.net




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel? cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to