Creating JSON file

2013-04-08 Thread Seth Gordon
You want to output a list of one dict per object, and you want that dict to contain another dict inside it. So you don’t need dict2. Instead f = file('report.json','a+') sys.stdout = f result = [] objects = game_objects.objects.all() for obj in objects: time = time_

Creating JSON file

2013-04-08 Thread Nagarajan Dharmar Sitha
saved = sys.stdout f = file('report.json','a+') sys.stdout = f result = [] objects = game_objects.objects.all() for obj in objects: dict2 ={} time = time_stamp.objects.filter(user_id = obj.user_id) obj_id = obj.object_id per = performance.objects.