I want to modify something with database hook, but I think on_fetch_item not working for me.
Here is my code:
def before_returning_contract(response):
print('About to return a contact')
if __name__ == '__main__':
app.on_fetched_item_contract += before_returning_contract
Bootstrap(app)
app.register_blueprint(eve_docs, url_prefix='/docs')
app.run(debug=True, host="127.0.0.1")
When I run it, (I mean when I go to 127.0.0.1:5000/contract/ObjID I didn't see print result in the console. I have just saw one time within 100 tries, but I never changed anything.