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
Currently, flask-admin does not easily support flask routes declared as async (see https://flask.palletsprojects.com/en/3.0.x/async-await/). While this isn't a dealbreaker, if you have a bunch of async code (e.g., if you're using flask-admin alongside a Quart app), then it's pretty annoying to have to manually wrap all your code in asyncio.run(...) (or loop.run_until_complete(...)). My understanding is that the limitation stems from the expose decorator which does not call ensure_sync. It would be nice if expose could wrap async functions, or if expose_async existed as an alternative. I'd be happy to help with a PR if either of these approaches seem reasonable.
The text was updated successfully, but these errors were encountered:
Currently, flask-admin does not easily support flask routes declared as async (see https://flask.palletsprojects.com/en/3.0.x/async-await/). While this isn't a dealbreaker, if you have a bunch of async code (e.g., if you're using flask-admin alongside a Quart app), then it's pretty annoying to have to manually wrap all your code in
asyncio.run(...)
(orloop.run_until_complete(...)
). My understanding is that the limitation stems from theexpose
decorator which does not callensure_sync
. It would be nice ifexpose
could wrap async functions, or ifexpose_async
existed as an alternative. I'd be happy to help with a PR if either of these approaches seem reasonable.The text was updated successfully, but these errors were encountered: