From 49f8f0fe5d59d16d6163938d5761fd29fcec8b12 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 6 Feb 2006 01:03:20 +0000 Subject: [PATCH] added 'engine' to convert_result_value/convert_bind_param --- doc/build/content/types.myt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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""" -- 2.47.2