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