我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用sqlalchemy_utils.PasswordType()。
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
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