async def get(username: str, fetch_password: bool = False) -> User_Pydantic: try: if fetch_password: user = await UserIn_Pydantic.from_queryset_single(User.get(username=username)) else: user = await User_Pydantic.from_queryset_single(User.get(username=username)) return user except DoesNotExist: raise NotImplementedException
def func() -> str: user = User.get(id=1) if user is not None: return jsonify(user.serialize) return jsonify({'error': 1})