本文整理汇总了Python中sqlalchemy.types.TypeDecorator类的典型用法代码示例。如果您正苦于以下问题:Python TypeDecorator类的具体用法?Python TypeDecorator怎么用?Python TypeDecorator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TypeDecorator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
"""
Initialize.
"""
# base
TypeDecorator.__init__(self)
开发者ID:borg-project,项目名称:cargo,代码行数:7,代码来源:alchemy.py
示例2: __init__
def __init__(self, choices, *, allow_unspecified=False, **kwargs):
"""
Args:
choices: an array of tuples, where the first element of each tuple
is the integer being stored and the second element is a string
description of the value.
allow_unspecified: by default, an exception is raised if you try
to save a row with a value which is not in the choices list
passed to this class; set this to True if you want to allow
non-default values.
"""
self.choices = dict(choices)
self.allow_unspecified = allow_unspecified
TypeDecorator.__init__(self, **kwargs)
开发者ID:magfest,项目名称:ubersystem,代码行数:14,代码来源:types.py
示例3: __init__
def __init__(self, *arg, **kw):
"""Init iLargeBinary type."""
self.__class__.impl = self.impl
TypeDecorator.__init__(self, *arg, **kw)
开发者ID:dset0x,项目名称:invenio,代码行数:4,代码来源:mysql.py
示例4: __init__
def __init__(self, *args, **kwargs):
self.enum_class = kwargs.pop('enum_class')
TypeDecorator.__init__(self, *args, **kwargs)
开发者ID:oinume,项目名称:dmm-eikaiwa-tsc,代码行数:3,代码来源:b4001f70c_create_schedule_table.py
示例5: __init__
def __init__(self):
TypeDecorator.__init__(self, asdecimal=False)
开发者ID:nrlakin,项目名称:impulse,代码行数:2,代码来源:aware_models.py
示例6: __init__
def __init__(self, *args, **kwargs):
kwargs['length'] = 100
TypeDecorator.__init__(self, *args, **kwargs)
开发者ID:mmariani,项目名称:abilian-core,代码行数:3,代码来源:models.py
示例7: __init__
def __init__(self):
TypeDecorator.__init__(self, 30)
开发者ID:Plurk,项目名称:Solace,代码行数:2,代码来源:database.py
示例8: __init__
def __init__(self, item_type, *args, **kwargs):
TypeDecorator.__init__(self, *args, **kwargs)
self.item_type = item_type
开发者ID:CyrilleFranchet,项目名称:ivre,代码行数:3,代码来源:tables.py
示例9: __init__
def __init__(self, enum, *args, **kwargs):
self._enum = enum
TypeDecorator.__init__(self, *args, **kwargs)
开发者ID:anxolerd,项目名称:Meowth,代码行数:3,代码来源:types.py
示例10: __init__
def __init__(self):
TypeDecorator.__init__(self, length=32)
开发者ID:jrha,项目名称:aquilon,代码行数:2,代码来源:guid.py
示例11: __init__
def __init__(self, *arg, **kw):
TypeDecorator.__init__(self, *arg, **kw)
开发者ID:uralbash,项目名称:pyramid_elfinder,代码行数:2,代码来源:models.py
示例12: __init__
def __init__(self, wibble=None, optionset='default', *args, **kw):
TypeDecorator.__init__(self, *args, **kw)
#super(ElfinderField, self).__init__()
self.optionset = optionset
self.wibble = wibble
开发者ID:RobertSudwarts,项目名称:tg2-elfinder,代码行数:5,代码来源:models.py
示例13: __init__
def __init__(self, *args, **kwargs):
if 'charset' in kwargs:
del kwargs['charset']
TypeDecorator.__init__(self, *args, **kwargs)
开发者ID:greylock,项目名称:batteries,代码行数:5,代码来源:types.py
示例14: __init__
def __init__(self, enum):
self.enum = enum
TypeDecorator.__init__(self)
SchemaType.__init__(self)
开发者ID:QLGu,项目名称:flask-spoilerplate,代码行数:4,代码来源:sqlalchemy.py
示例15: __init__
def __init__(*args, **kwargs):
kwargs['length'] = 10 * 1024 * 1024;
TypeDecorator.__init__(*args, **kwargs)
开发者ID:gunnarbeutner,项目名称:zfsci,代码行数:3,代码来源:joblib.py
示例16: __init__
def __init__(self, enum, values):
self.enum = enum
self.values = values
TypeDecorator.__init__(self)
开发者ID:atishn,项目名称:Finance-Planner,代码行数:4,代码来源:db.py
示例17: __init__
def __init__(self, prefix, *args, **kw):
TypeDecorator.__init__(self, *args, **kw)
self.prefix = prefix
开发者ID:w3bcr4ft,项目名称:autonomie,代码行数:3,代码来源:types.py
示例18: __init__
def __init__(self, *args, **kwargs):
assert self.Type is not None
kwargs.setdefault('length', self.default_max_length)
TypeDecorator.__init__(self, *args, **kwargs)
开发者ID:debon,项目名称:abilian-core,代码行数:4,代码来源:singleton.py
示例19: __init__
def __init__(self, pathspec, *args, **kwargs):
self.resolver = AssetResolver()
self.pathspec = pathspec
TypeDecorator.__init__(self, *args, **kwargs)
开发者ID:greylock,项目名称:batteries,代码行数:5,代码来源:storable.py
示例20: load_dialect_impl
def load_dialect_impl(self, dialect, **kwargs):
if dialect.name.startswith('postgres'):
return dialect.type_descriptor(TEXT)
return TypeDecorator.load_dialect_impl(self, dialect, **kwargs)
开发者ID:audip,项目名称:lunr,代码行数:4,代码来源:jsonimpl.py
注:本文中的sqlalchemy.types.TypeDecorator类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论