python - class named 'User' , error : 'object has no attribute' for any method -
i have class in models
class user(ndb.model): username = ndb.stringproperty(required=true) password_hash = ndb.stringproperty(required=true) def hash_password(self, password): self.password_hash = pwd_context.encrypt(password) def verify_password(self, password): homecoming pwd_context.verify(password, self.password_hash) when seek phone call
user = user(username = _username) user.hash_password(_password) it gives error
'user' object has no attribute 'hash_password' am doing blunder here ?
updatethe problem class name user , changing other name works fine. may conflicting gae model user.
it should work. maybe have indentation error (e.g mixing tabs spaces) in original code.
python google-app-engine
No comments:
Post a Comment