a bit more informative return value when posting
This commit is contained in:
parent
0e2c092ce3
commit
ac9770dd89
|
@ -51,8 +51,8 @@ app = Sanic('peewee_example')
|
||||||
|
|
||||||
@app.route('/post')
|
@app.route('/post')
|
||||||
async def post(request):
|
async def post(request):
|
||||||
await objects.create(KeyValue, key='my_first_async_db', text="I was inserted asynchronously!")
|
obj = await objects.create(KeyValue, key='my_first_async_db', text="I was inserted asynchronously!")
|
||||||
return json({'success': True})
|
return json({'object_id': obj.id})
|
||||||
|
|
||||||
|
|
||||||
@app.route('/get')
|
@app.route('/get')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user