]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added 'engine' to convert_result_value/convert_bind_param
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 6 Feb 2006 01:03:20 +0000 (01:03 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 6 Feb 2006 01:03:20 +0000 (01:03 +0000)
doc/build/content/types.myt

index 356cd85bf58948aace80a7e736a0662e5a7b3cf9..a8a9adc40d6454022c5a2614e68be2ba22842456 100644 (file)
@@ -55,9 +55,9 @@ class BOOLEAN(Boolean)
     class MyType(types.TypeDecorator, types.String):
         """basic type that decorates String, prefixes values with "PREFIX:" on 
         the way in and strips it off on the way out."""
-        def convert_bind_param(self, value):
+        def convert_bind_param(self, value, engine):
             return "PREFIX:" + value
-        def convert_result_value(self, value):
+        def convert_result_value(self, value, engine):
             return value[7:]
 </&>
 <p>Another example, which illustrates a fully defined datatype.  This just overrides the base type class TypeEngine:</p>
@@ -69,9 +69,9 @@ class BOOLEAN(Boolean)
             self.precision = precision
         def get_col_spec(self):
             return "MYTYPE(%s)" % self.precision
-        def convert_bind_param(self, value):
+        def convert_bind_param(self, value, engine):
             return value
-        def convert_result_value(self, value):
+        def convert_result_value(self, value, engine):
             return value
         def adapt(self, typeobj):
             """produces an adaptation of this object given a type which is a subclass of this object"""