Python sqlalchemy_utils 模块,PasswordType() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用sqlalchemy_utils.PasswordType()

项目:CodeGra.de    作者:CodeGra-de    | 项目源码 | 文件源码
def render_item(type_, col, autogen_context):
    if type_ == "type" and isinstance(col, PasswordType):
        autogen_context.imports.add("import sqlalchemy_utils")
        return "sqlalchemy_utils.PasswordType"
    else:
        return False
项目:deb-python-sqlalchemy-utils    作者:openstack    | 项目源码 | 文件源码
def __init__(self, max_length=None, **kwargs):
        # Fail if passlib is not found.
        if passlib is None:
            raise ImproperlyConfigured(
                "'passlib' is required to use 'PasswordType'"
            )

        # Construct the passlib crypt context.
        self.context = LazyCryptContext(**kwargs)

        self._max_length = max_length