Checklist
Describe the bug
Ajax request from browser doesn't consider urn which setted up by sub fastapi app.
Steps to reproduce the bug
- Link admin to sub fastapi app:
from fastapi import FastApi
from sqladmin import Admin
app = FastApi()
subapp = FastApi()
app.mount('/suburn', subapp)
admin = Admin(subapp, base_url='/')
- Link any ModelView with relationship with admin which forces ajax request at select list on create page.
- Click on select list on create page and try to type symbols.
Expected behavior
Ajax should request to uri as: .../suburn/ModelViewName/ajax/...
Actual behavior
Ajax request to uri: .../ModelViewName/ajax/... with skipping suburn.
P.S. Admin page routing is correct with sub app.
Debugging material
In my way:
suburn='/admin'
base_url='/'
[INFO] uvicorn.access: 127.0.0.1:64082 - "GET /admin/enterprise/list HTTP/1.1" 200
[INFO] uvicorn.access: 127.0.0.1:64082 - "GET /admin/enterprise/create HTTP/1.1" 200
[INFO] uvicorn.access: 127.0.0.1:64082 - "GET /enterprise/ajax/lookup?name=company&term=2 HTTP/1.1" 404
Environment
OS:
MacOS 14.4.1
Python:
3.11.8
sqladmin==0.16.1
fastapi==0.110.1
Additional context
I understand that suburn not passed to template ajax, but all another routing work correctly - it confused me.
(I think that we need additional param like sub_url separatly off base_url to specific behavior.)
Checklist
master.Describe the bug
Ajax request from browser doesn't consider urn which setted up by sub fastapi app.
Steps to reproduce the bug
Expected behavior
Ajax should request to uri as:
.../suburn/ModelViewName/ajax/...Actual behavior
Ajax request to uri:
.../ModelViewName/ajax/...with skippingsuburn.P.S. Admin page routing is correct with sub app.
Debugging material
In my way:
suburn='/admin'
base_url='/'
Environment
OS:
MacOS 14.4.1
Python:
3.11.8
sqladmin==0.16.1
fastapi==0.110.1
Additional context
I understand that suburn not passed to template ajax, but all another routing work correctly - it confused me.
(I think that we need additional param like
sub_urlseparatly offbase_urlto specific behavior.)