def set_password(self, new_password):
        """ 设置密码 """
        info = self.gen_password_and_salt(new_password)
        self.password = info['password']
        self.salt = info['salt']
        self.save()
def set_password(self, new_password):
        """ 设置密码 """
        info = self.gen_password_and_salt(new_password)
        self.password = info['password']
        self.salt = info['salt']
        self.save()
def set_password ( self , new_password ) : info = self . gen_password_and_salt ( new_password ) self . password = info [ 'password' ] self . salt = info [ 'salt' ] self . save ( )
设置密码
设置密码