Using on_pre_GET in blueprint

16 views
Skip to first unread message

m...@alanhollis.com

unread,
Nov 20, 2018, 5:40:49 PM11/20/18
to Eve REST Framework
Hi all,

Is it possible to use the on_pre_GET function inside a blueprint? I've seen the docs where I can use other hooks easily and that's working fine, but I can't figure out how I would implement something like:

from flask import request
@blueprint.route('/events/tags', methods=['GET'])
def get_tags():
getattr(app, "on_pre_GET")()

This fails currently because the parameters which would usually be set by the pre_event decorator are not set.

from flask import request
@blueprint.route('/events/tags', methods=['GET'])
@pre_event
def get_tags():

Also wont suffice as it doesn't then get the request proxy object.

Any ideas would be greatly appreciated.

Reply all
Reply to author
Forward
0 new messages