Comments (1)
Hello - thanks in advance for an awesome open sourced repo! I'm also interested in how we can support a connection to multiple databases. On thing I've tried is to have multiple Admin
view associated with a single FastAPI app.
admins = [
Admin(app, create_engine(database_dsn), base_url=f"/{customer_name}", title=customer_name)
for customer_name, database_dsn in multiple_databases
]
for admin in admins:
admin.add_view(MyView)
This builds correctly but when we then dig into each admin app, the links point to the wrong Admin app for the customer. For example, if I'm looking at models for customer B (url=mysite.com/customer-b
), all the links in the app will point to customer A (url=mysite.com/customer-a/item
). I've traced the issue to to this spot https://github.com/aminalaee/sqladmin/blob/main/sqladmin/application.py#L406 where the mounted app is associated with name='admin' which may be contributing to mixed links if using multiple admin views.
Happy to contribute to solve for the multi-database use case but wanted to see if there are any ideas
from sqladmin.
Related Issues (20)
- issue with Admin session_maker type hint HOT 3
- relationship + search HOT 10
- Bulk delete shows no confirmation prompt HOT 2
- Allow `list_query` be defined as ModelAdmin method
- Request to be able to divide admin models into groups
- Admin does not detect nullable fields for SQLAlchemy v2 HOT 2
- Tag field is pre-populated with an unrelated value HOT 4
- Customized sort_query HOT 1
- Bug for Menu order changing with each reload HOT 2
- SQLAlchemy-Utils UUIDType `TypeError: string argument without an encoding` HOT 14
- Columns from relationahip can't be sorted or searched HOT 16
- Issue with latest wtforms release HOT 2
- overide delete_model method HOT 1
- Can't save with a ModelView to a Model that has a column named data HOT 7
- Sort sidepanel HOT 1
- My id contains slash
- TypeError: UUID objects are immutable" when try view, delete, update user from fastapi-users in sqladmin panel HOT 7
- Object identifier values function not parsing correctly path parameters when a field is False
- form_type_formatters
- Changing color theme HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqladmin.