Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #5
0
 def type_descriptor(self, typeobj):
     return sqltypes.adapt_type(typeobj, colspecs)
Beispiel #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
Beispiel #7
0
 def type_descriptor(self, typeobj):
     return sqltypes.adapt_type(typeobj, colspecs)
Beispiel #8
0
 def type_descriptor(self, typeobj):
     newobj = types.adapt_type(typeobj, self.colspecs)
     return newobj
Beispiel #9
0
 def type_descriptor(self, typeobj):
     newobj = sqltypes.adapt_type(typeobj, self.colspecs)
     return newobj
Beispiel #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
Beispiel #11
0
 def type_descriptor(self, typeobj):
   """ Inputs: generic type to be converted
       Returns: converted adapter type
   """
   return sa_types.adapt_type(typeobj, colspecs)
Beispiel #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)
Beispiel #13
0
 def type_descriptor(self, typeobj):
     """ Inputs: generic type to be converted
     Returns: converted adapter type
 """
     return sa_types.adapt_type(typeobj, colspecs)
Beispiel #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)