Here are the examples of the python api sqlalchemy.types.TypeDecorator.__init__ taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
13 Examples
2
Example 1
def __init__(self, parts, separator=u'.', length = None, **kwargs):
import string
translator = string.maketrans('', '')
self.parts = parts
self.separator = separator
max_length = sum(len(part.translate(translator, '<>!')) for part in parts) + len(parts)*len(self.separator)
types.TypeDecorator.__init__( self, length = length or max_length, **kwargs )
0
Example 2
def __init__(self, thumbnail_size=(20, 20, True), size=(100, 100, True), **kw):
types.TypeDecorator.__init__(self, **kw)
self.thumbnail_size = thumbnail_size
self.size = size
0
Example 3
def __init__(self):
types.TypeDecorator.__init__(self, length=20)
0
Example 4
def __init__(self):
types.TypeDecorator.__init__(self, length=8)
0
Example 5
def __init__(self, choices=[], **kwargs):
types.TypeDecorator.__init__(self, **kwargs)
self._int_to_string = dict(choices)
self._string_to_int = dict((v,k) for (k,v) in choices)
self.choices = [v for (k,v) in choices]
0
Example 6
def __init__(self, max_length=100, upload_to=u'', storage=Storage, **kwargs):
self.max_length = max_length
self.storage = storage(upload_to, self.stored_file_implementation)
types.TypeDecorator.__init__(self, length=max_length, **kwargs)
0
Example 7
def __init__(self, length=1, **kwargs):
self.length = length
sa.types.TypeDecorator.__init__(self, **kwargs)
0
Example 8
def __init__(self, enum_class, *args, **kwargs):
self.enum_class = enum_class
return types.TypeDecorator.__init__(self, *args, **kwargs)
0
Example 9
def __init__(self):
return types.TypeDecorator.__init__(self)
0
Example 10
def __init__(self):
TypeDecorator.__init__(self, 10)
0
Example 11
def __init__(self):
TypeDecorator.__init__(self, 30)
-1
Example 12
def __init__(self):
self.impl.length = 16
types.TypeDecorator.__init__(self, length=self.impl.length)
-1
Example 13
def __init__(self, prefix, *args, **kw):
TypeDecorator.__init__(self, *args, **kw)
self.prefix = prefix