Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register_output_renderer render callback should be optionally awaitable #776

Closed
simonw opened this issue May 28, 2020 · 1 comment
Closed

Comments

@simonw
Copy link
Owner

simonw commented May 28, 2020

In #581 I made a bunch of improvements to this, including making datasette available to it so it could execute queries.

But... it needs to be able to await in order to do that. Which means it should be optionally-awaitable.

Original idea here: #645 (comment)

@simonw
Copy link
Owner Author

simonw commented May 28, 2020

Example code from elsewhere:

extras = {}
if callable(extra_template_data):
extras = extra_template_data()
if asyncio.iscoroutine(extras):
extras = await extras

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

No branches or pull requests

1 participant