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

Investigate syntactic sugar for plugins #220

Closed
simonw opened this issue Apr 16, 2018 · 2 comments
Closed

Investigate syntactic sugar for plugins #220

simonw opened this issue Apr 16, 2018 · 2 comments

Comments

@simonw
Copy link
Owner

simonw commented Apr 16, 2018

Suggested by @andrewhayward on Twitter: https://twitter.com/arhayward/status/986015118965268480?s=21

Have you considered a basic abstraction on top of that, for standard hook features?

@sql_function
random_integer(a,b):
    return random.randint(a,b)

@template_filter
uppercase(str):
    return str.upper()

Maybe from datasette.plugins import template_filter?

Would have to work out how to get this to play well with pluggy

@simonw simonw added the plugins label Apr 16, 2018
@simonw
Copy link
Owner Author

simonw commented Apr 16, 2018

This could also help workaround the current predicament that a single plugin can only define one prepare_connection hook.

@simonw
Copy link
Owner Author

simonw commented Jun 11, 2020

I'm OK with not implementing this - I've got used to the existing mechanism, and it doesn't frustrate me enough to work on this more.

@simonw simonw closed this as completed Jun 11, 2020
@simonw simonw added the wontfix label Jun 11, 2020
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