def authenticate(self, username=None, password=None): try: user = User.get_one(username) if user.check_password(password): return user except User.DoesNotExist, User.MultipleExist: return None
def get_user(self, user_id): return User.get(user_id)