我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用sqlalchemy.types.SchemaType()。
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) )
def _is_type_bound(constraint): # this deals with SQLAlchemy #3260, don't copy CHECK constraints # that will be generated by the type. if util.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) )