sqlalchemy.types.TypeDecorator.__init__

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 7

Example 1

Project: Camelot Source File: __init__.py
Function: init
    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 )

Example 2

Project: Flask-AppBuilder Source File: mixins.py
Function: init
    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

Example 3

Project: Camelot Source File: __init__.py
Function: init
    def __init__(self):
        types.TypeDecorator.__init__(self, length=20)

Example 4

Project: Camelot Source File: __init__.py
Function: init
    def __init__(self):
        types.TypeDecorator.__init__(self, length=8)

Example 5

Project: Camelot Source File: __init__.py
Function: init
    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]

Example 6

Project: Camelot Source File: __init__.py
Function: init
    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)

Example 7

Project: sqlalchemy-utils Source File: bit.py
Function: init
    def __init__(self, length=1, **kwargs):
        self.length = length
        sa.types.TypeDecorator.__init__(self, **kwargs)

Example 8

Project: COSMOS2 Source File: sqla.py
Function: init
    def __init__(self, enum_class, *args, **kwargs):
        self.enum_class = enum_class
        return types.TypeDecorator.__init__(self, *args, **kwargs)

Example 9

Project: COSMOS2 Source File: sqla.py
Function: init
    def __init__(self):
        return types.TypeDecorator.__init__(self)

Example 10

Project: solace Source File: database.py
Function: init
    def __init__(self):
        TypeDecorator.__init__(self, 10)

Example 11

Project: solace Source File: database.py
Function: init
    def __init__(self):
        TypeDecorator.__init__(self, 30)

Example 12

Project: cloud-asr Source File: schema.py
Function: init
    def __init__(self):
        self.impl.length = 16
        types.TypeDecorator.__init__(self, length=self.impl.length)

Example 13

Project: autonomie Source File: types.py
Function: init
    def __init__(self, prefix, *args, **kw):
        TypeDecorator.__init__(self, *args, **kw)
        self.prefix = prefix