a bit more informative return value when posting

This commit is contained in:
narzeja 2016-10-22 08:46:26 +02:00
parent 0e2c092ce3
commit ac9770dd89

View File

@ -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')