示例#1
0
 def change_password(self, password):
     self.password = bc.generate_password_hash(password).decode('utf-8')
示例#2
0
    def create_user(cls, username, password):
        hashed_pw = bc.generate_password_hash(password).decode('utf-8')
        new_user = cls(username=username, password=hashed_pw)

        db.session.add(new_user)
        db.session.commit()
示例#3
0
 def create_model(self, form):
     form.password.data = bc.generate_password_hash(form.password.data)
     super().create_model(form)