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 found myself wanting to add a custom validator to a form that makes an asynchronous HTTP request (using httpx) to confirm that a provided URL was valid - but realized that wtforms currently only supports blocking synchronous functions for validators.
It would be great if wtforms provided an async validation mechanism in the default package. It's an increasingly common pattern thanks to the popularity of projects like Starlette and FastAPI. My own Datasette package uses async and has recently adopted wtforms for the enrichments feature, which is how I found this limitation.
The text was updated successfully, but these errors were encountered:
I found myself wanting to add a custom validator to a form that makes an asynchronous HTTP request (using
httpx
) to confirm that a provided URL was valid - but realized thatwtforms
currently only supports blocking synchronous functions for validators.There is a project that extends
wtforms
to work withasync
, but it's packaged for Starlette which I'm not using here: https://github.com/kubetail-org/starlette-wtf/blob/master/starlette_wtf/form.pyIt would be great if
wtforms
provided an async validation mechanism in the default package. It's an increasingly common pattern thanks to the popularity of projects like Starlette and FastAPI. My own Datasette package uses async and has recently adoptedwtforms
for the enrichments feature, which is how I found this limitation.The text was updated successfully, but these errors were encountered: