Skip to content

Mention that filters_from_request can return an async function - #2866

Open
cycsmail wants to merge 1 commit into
simonw:mainfrom
cycsmail:filters-from-request-async-docs-1638
Open

Mention that filters_from_request can return an async function#2866
cycsmail wants to merge 1 commit into
simonw:mainfrom
cycsmail:filters-from-request-async-docs-1638

Conversation

@cycsmail

@cycsmail cycsmail commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Closes:

The filters_from_request hook can return an async def function (Datasette calls it and awaits the result via await_me_maybe), so you can run SQL or other async work while building your filters. The docs didn't mention this, so I added a short note to the filters_from_request section pointing it out and linking to the default implementations in datasette/filters.py.

Also added a small test_docs.py check that the documented section mentions async def; it fails without the doc change and passes with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant