You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried running the ormar example as is and it did not work:
# OS: macOS
(venv) $ python --version
Python 3.9.1
(venv) $ pip freeze
aiosqlite==0.17.0
click==7.1.2
databases==0.4.1
Faker==8.1.0
fastapi==0.63.0
fastapi-pagination==0.7.0
h11==0.12.0
ormar==0.10.4
pydantic==1.8
python-dateutil==2.8.1
six==1.15.0
SQLAlchemy==1.3.23
starlette==0.13.6
text-unidecode==1.3
typing-extensions==3.7.4.3
uvicorn==0.13.4
(venv) $ uvicorn pagination_ormar:app --reload
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [60370] using statreload
INFO: Started server process [60372]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: 127.0.0.1:58059 - "GET /docs HTTP/1.1" 200 OK
INFO: 127.0.0.1:58059 - "GET /openapi.json HTTP/1.1" 200 OK
INFO: 127.0.0.1:58059 - "GET /docs HTTP/1.1" 200 OK
INFO: 127.0.0.1:58059 - "GET /openapi.json HTTP/1.1" 200 OK
INFO: 127.0.0.1:58059 - "GET /users/limit-offset?limit=50&offset=0 HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "./venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 396, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "./venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "./venv/lib/python3.9/site-packages/fastapi/applications.py", line 199, in __call__
await super().__call__(scope, receive, send)
File "./venv/lib/python3.9/site-packages/starlette/applications.py", line 111, in __call__
await self.middleware_stack(scope, receive, send)
File "./venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "./venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "./venv/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "./venv/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "./venv/lib/python3.9/site-packages/starlette/routing.py", line 566, in __call__
await route.handle(scope, receive, send)
File "./venv/lib/python3.9/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "./venv/lib/python3.9/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "./venv/lib/python3.9/site-packages/fastapi/routing.py", line 209, in app
response_data = await serialize_response(
File "./venv/lib/python3.9/site-packages/fastapi/routing.py", line 109, in serialize_response
response_content = _prepare_response_content(
File "./venv/lib/python3.9/site-packages/fastapi/routing.py", line 66, in _prepare_response_content
return res.dict(
File "pydantic/main.py", line 495, in pydantic.main.BaseModel.dict
File "pydantic/main.py", line 859, in _iter
File "pydantic/main.py", line 800, in pydantic.main.BaseModel._get_value
File "pydantic/main.py", line 785, in genexpr
File "pydantic/main.py", line 749, in pydantic.main.BaseModel._get_value
File "./venv/lib/python3.9/site-packages/ormar/models/newbasemodel.py", line 700, in dict
pk_only = object.__getattribute__(self, "__pk_only__")
AttributeError: __pk_only__
INFO: 127.0.0.1:58066 - "GET /users/default?page=0&size=50 HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "./venv/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 396, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "./venv/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "./venv/lib/python3.9/site-packages/fastapi/applications.py", line 199, in __call__
await super().__call__(scope, receive, send)
File "./venv/lib/python3.9/site-packages/starlette/applications.py", line 111, in __call__
await self.middleware_stack(scope, receive, send)
File "./venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "./venv/lib/python3.9/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "./venv/lib/python3.9/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "./venv/lib/python3.9/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "./venv/lib/python3.9/site-packages/starlette/routing.py", line 566, in __call__
await route.handle(scope, receive, send)
File "./venv/lib/python3.9/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "./venv/lib/python3.9/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "./venv/lib/python3.9/site-packages/fastapi/routing.py", line 209, in app
response_data = await serialize_response(
File "./venv/lib/python3.9/site-packages/fastapi/routing.py", line 109, in serialize_response
response_content = _prepare_response_content(
File "./venv/lib/python3.9/site-packages/fastapi/routing.py", line 66, in _prepare_response_content
return res.dict(
File "pydantic/main.py", line 495, in pydantic.main.BaseModel.dict
File "pydantic/main.py", line 859, in _iter
File "pydantic/main.py", line 800, in pydantic.main.BaseModel._get_value
File "pydantic/main.py", line 785, in genexpr
File "pydantic/main.py", line 749, in pydantic.main.BaseModel._get_value
File "./venv/lib/python3.9/site-packages/ormar/models/newbasemodel.py", line 700, in dict
pk_only = object.__getattribute__(self, "__pk_only__")
AttributeError: __pk_only__
I tried running the
ormar
example as is and it did not work:CC @collerek
The text was updated successfully, but these errors were encountered: