From ac9770dd8926cb52fd0d38c27bd18a930dc312ea Mon Sep 17 00:00:00 2001 From: narzeja Date: Sat, 22 Oct 2016 08:46:26 +0200 Subject: [PATCH] a bit more informative return value when posting --- examples/sanic_peewee.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/sanic_peewee.py b/examples/sanic_peewee.py index fed03e02..a364d3ce 100644 --- a/examples/sanic_peewee.py +++ b/examples/sanic_peewee.py @@ -51,8 +51,8 @@ app = Sanic('peewee_example') @app.route('/post') async def post(request): - await objects.create(KeyValue, key='my_first_async_db', text="I was inserted asynchronously!") - return json({'success': True}) + obj = await objects.create(KeyValue, key='my_first_async_db', text="I was inserted asynchronously!") + return json({'object_id': obj.id}) @app.route('/get')