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

Have schema_context operate as a decorator too. #199

Closed
phalt opened this issue Nov 6, 2018 · 1 comment · Fixed by #201
Closed

Have schema_context operate as a decorator too. #199

phalt opened this issue Nov 6, 2018 · 1 comment · Fixed by #201

Comments

@phalt
Copy link
Contributor

phalt commented Nov 6, 2018

Currently schema_context operates as a context manager but does not appear to behave as a decorator.

It would be nice if it could support both. This is possible from python 3.2 onwards.

An example would be something like:

@schema_context('tenant')
def a_function_that_i_want_to_run_for_one_tenant(*args, **kwargs):
    ...
@phalt
Copy link
Contributor Author

phalt commented Nov 6, 2018

Actually ya know what, I'll make a PR for this :)

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 a pull request may close this issue.

1 participant