本文整理汇总了Python中sqlalchemy.types.SchemaType方法的典型用法代码示例。如果您正苦于以下问题:Python types.SchemaType方法的具体用法?Python types.SchemaType怎么用?Python types.SchemaType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sqlalchemy.types
的用法示例。
在下文中一共展示了types.SchemaType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _is_type_bound
# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import SchemaType [as 别名]
def _is_type_bound(constraint):
# this deals with SQLAlchemy #3260, don't copy CHECK constraints
# that will be generated by the type.
if sqla_100:
# new feature added for #3260
return constraint._type_bound
else:
# old way, look at what we know Boolean/Enum to use
return (
constraint._create_rule is not None and
isinstance(
getattr(constraint._create_rule, "target", None),
sqltypes.SchemaType)
)
示例2: __init__
# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import SchemaType [as 别名]
def __init__(self):
TypeDecorator.__init__(self)
sqltypes.SchemaType.__init__(self)
示例3: test_before_parent_attach_typedec_enclosing_schematype
# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import SchemaType [as 别名]
def test_before_parent_attach_typedec_enclosing_schematype(self):
# additional test for [ticket:2919] as part of test for
# [ticket:3832]
class MySchemaType(sqltypes.TypeEngine, sqltypes.SchemaType):
pass
target_typ = MySchemaType()
class MyType(TypeDecorator):
impl = target_typ
typ = MyType()
self._test_before_parent_attach(typ, target_typ, double=True)
示例4: test_before_parent_attach_typedec_of_schematype
# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import SchemaType [as 别名]
def test_before_parent_attach_typedec_of_schematype(self):
class MyType(TypeDecorator, sqltypes.SchemaType):
impl = String
typ = MyType()
self._test_before_parent_attach(typ)
示例5: test_before_parent_attach_schematype_of_typedec
# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import SchemaType [as 别名]
def test_before_parent_attach_schematype_of_typedec(self):
class MyType(sqltypes.SchemaType, TypeDecorator):
impl = String
typ = MyType()
self._test_before_parent_attach(typ)