def type_descriptor(self, typeobj): if isinstance(typeobj, type): typeobj = typeobj() if isinstance(typeobj, sqltypes.Unicode): return typeobj.adapt(MaxUnicode) else: return sqltypes.adapt_type(typeobj, colspecs)
def type_descriptor(self, typeobj): """Provide a database-specific ``TypeEngine`` object, given the generic object which comes from the types module. This method looks for a dictionary called ``colspecs`` as a class or instance-level variable, and passes on to ``types.adapt_type()``. """ return sqltypes.adapt_type(typeobj, self.colspecs)
def type_descriptor(self, typeobj): return sqltypes.adapt_type(typeobj, colspecs)
def type_descriptor(self, typeobj): newobj = sqltypes.adapt_type(typeobj, self.colspecs) # Some types need to know about the dialect if isinstance(newobj, (MSText, MSNVarchar)): newobj.dialect = self return newobj
def type_descriptor(self, typeobj): newobj = types.adapt_type(typeobj, self.colspecs) return newobj
def type_descriptor(self, typeobj): newobj = sqltypes.adapt_type(typeobj, self.colspecs) return newobj
def type_descriptor(self, typeobj): """ Inputs: generic type to be converted Returns: converted adapter type """ return sa_types.adapt_type(typeobj, colspecs)
def type_descriptor(self, typeobj): if self.version == 2: return sqltypes.adapt_type(typeobj, pg2_colspecs) else: return sqltypes.adapt_type(typeobj, pg1_colspecs)