當前位置: 首頁>>代碼示例>>Python>>正文


Python types.SchemaType方法代碼示例

本文整理匯總了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)
        ) 
開發者ID:jpush,項目名稱:jbox,代碼行數:16,代碼來源:sqla_compat.py

示例2: __init__

# 需要導入模塊: from sqlalchemy import types [as 別名]
# 或者: from sqlalchemy.types import SchemaType [as 別名]
def __init__(self):
            TypeDecorator.__init__(self)
            sqltypes.SchemaType.__init__(self) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:5,代碼來源:test_metadata.py

示例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) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:16,代碼來源:test_metadata.py

示例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) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:8,代碼來源:test_metadata.py

示例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) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:8,代碼來源:test_metadata.py


注:本文中的sqlalchemy.types.SchemaType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。