Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
 def type_descriptor(self, typeobj):
     return sqltypes.adapt_type(typeobj, colspecs)
Exemplo n.º 6
0
 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
Exemplo n.º 7
0
 def type_descriptor(self, typeobj):
     return sqltypes.adapt_type(typeobj, colspecs)
Exemplo n.º 8
0
 def type_descriptor(self, typeobj):
     newobj = types.adapt_type(typeobj, self.colspecs)
     return newobj
Exemplo n.º 9
0
 def type_descriptor(self, typeobj):
     newobj = sqltypes.adapt_type(typeobj, self.colspecs)
     return newobj
Exemplo n.º 10
0
 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
Exemplo n.º 11
0
 def type_descriptor(self, typeobj):
   """ Inputs: generic type to be converted
       Returns: converted adapter type
   """
   return sa_types.adapt_type(typeobj, colspecs)
Exemplo n.º 12
0
 def type_descriptor(self, typeobj):
     if self.version == 2:
         return sqltypes.adapt_type(typeobj, pg2_colspecs)
     else:
         return sqltypes.adapt_type(typeobj, pg1_colspecs)
Exemplo n.º 13
0
 def type_descriptor(self, typeobj):
     """ Inputs: generic type to be converted
     Returns: converted adapter type
 """
     return sa_types.adapt_type(typeobj, colspecs)
Exemplo n.º 14
0
 def type_descriptor(self, typeobj):
     if self.version == 2:
         return sqltypes.adapt_type(typeobj, pg2_colspecs)
     else:
         return sqltypes.adapt_type(typeobj, pg1_colspecs)