objects -- выборка из базы Example objects all dict_objects_list for o

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# objects -- выборка из базы, Example.objects.all()
dict_objects_list = []
for objects in objects_list:
if isinstance(objects, dict):
dict_objects_list.append(objects)
else:
dict_objects = {}
for object in objects:
dict_objects[str(object.date)] = object
dict_objects_list.append(dict_objects)