better get example

This commit is contained in:
narzeja 2016-10-22 08:52:37 +02:00
parent b048f1bad3
commit be0739614d

View File

@ -66,7 +66,11 @@ async def get(request):
all_objects = await objects.execute(KeyValue.select()) all_objects = await objects.execute(KeyValue.select())
serialized_obj = [] serialized_obj = []
for obj in all_objects: for obj in all_objects:
serialized_obj.append({obj.key: obj.text}) serialized_obj.append({
'id': obj.id,
'key': obj.key,
'value': obj.text}
)
return json({'objects': serialized_obj}) return json({'objects': serialized_obj})