Checklist
- [X] The bug is reproducible against the latest release or
master
.
- [X] There are no similar issues or pull requests to fix it yet.
Describe the bug
If field of model has PhoneNumberType
from sqlalchemy_utils, you cannot create or edit new records.
Steps to reproduce the bug
- Made model with
- Add to admin panel.
- Try to create new one or update old one.
Expected behavior
Can edit and create new records.
Actual behavior
Getting Internal Error.
Debugging material
Traceback (most recent call last):
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/fastapi/applications.py", line 270, in __call__
await super().__call__(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/applications.py", line 124, in __call__
await self.middleware_stack(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
raise exc
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/cors.py", line 84, in __call__
await self.app(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
raise exc
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
raise e
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/routing.py", line 706, in __call__
await route.handle(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/routing.py", line 443, in handle
await self.app(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/applications.py", line 124, in __call__
await self.middleware_stack(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
raise exc
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/sessions.py", line 86, in __call__
await self.app(scope, receive, send_wrapper)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
raise exc
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/routing.py", line 706, in __call__
await route.handle(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/sqladmin/authentication.py", line 56, in wrapper_decorator
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/sqladmin/application.py", line 465, in edit
Form = await model_view.scaffold_form()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/sqladmin/models.py", line 1005, in scaffold_form
return await get_model_form(
^^^^^^^^^^^^^^^^^^^^^
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/sqladmin/forms.py", line 536, in get_model_form
field = await converter.convert(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/sqladmin/forms.py", line 302, in convert
converter = self.get_converter(prop=prop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aryadovoy/Documents/coding/back/.venv/lib/python3.11/site-packages/sqladmin/forms.py", line 255, in get_converter
raise NoConverterFound( # pragma: nocover
sqladmin.exceptions.NoConverterFound: Could not find field converter for column phone_number (<class 'sqlalchemy_utils.types.phone_number.PhoneNumberType'>).
Environment
OS: Fedora Linux 35 (KDE Plasma) x86_64
Python: 3.11.0
SQLAdmin: 0.8.0
Additional context
No response