From: Mike Bayer Date: Mon, 6 Feb 2006 01:03:20 +0000 (+0000) Subject: added 'engine' to convert_result_value/convert_bind_param X-Git-Tag: rel_0_1_0~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49f8f0fe5d59d16d6163938d5761fd29fcec8b12;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added 'engine' to convert_result_value/convert_bind_param --- diff --git a/doc/build/content/types.myt b/doc/build/content/types.myt index 356cd85bf5..a8a9adc40d 100644 --- a/doc/build/content/types.myt +++ b/doc/build/content/types.myt @@ -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:]

Another example, which illustrates a fully defined datatype. This just overrides the base type class TypeEngine:

@@ -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"""