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

Feature Request: Ability to receive connection not in routes #20

Open
Jwink3101 opened this issue Oct 2, 2017 · 0 comments
Open

Feature Request: Ability to receive connection not in routes #20

Jwink3101 opened this issue Oct 2, 2017 · 0 comments

Comments

@Jwink3101
Copy link

I like the concept of this plugin, but I found I had to roll my own because I needed a way to get a database connection object (with all of the same settings) in function that do not originate as the route. For example, I had something along the lines of

@route('/special')
def special():
    do_something_special()
    return main()

@route('/')
def main(db):
    content = do_main_stuff_with_db()
    return content

That is just one example. Another one would be if there is something with the DB in the background (say, in a thread that checks the DB occasionally)

Just thought I would suggest this.

Thanks!

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

No branches or pull requests

1 participant