本文整理匯總了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)