Skip to content

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

Description

@Jwink3101

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!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions