def set_password(self, password): self.hashed_password = bcrypt.hashpw( password.encode("utf-8"), bcrypt.gensalt())