app/soc/views/models/program.py
changeset 2147 5dd2091c8f0c
parent 2140 32b0731f0bf5
child 2149 8e6f98adb243
equal deleted inserted replaced
2146:57c74ce47fa3 2147:5dd2091c8f0c
   297     locked_slots = adjusted_slots = {}
   297     locked_slots = adjusted_slots = {}
   298 
   298 
   299     if request.method == 'POST' and 'result' in request.POST:
   299     if request.method == 'POST' and 'result' in request.POST:
   300       result = request.POST['result']
   300       result = request.POST['result']
   301       submit = request.GET.get('submit')
   301       submit = request.GET.get('submit')
       
   302       load = request.GET.get('load')
       
   303       stored = program.slots_allocation
       
   304 
       
   305       if load and stored:
       
   306         result = stored
   302 
   307 
   303       from_json = simplejson.loads(result)
   308       from_json = simplejson.loads(result)
       
   309 
   304       locked_slots = dicts.groupDictBy(from_json, 'locked', 'slots')
   310       locked_slots = dicts.groupDictBy(from_json, 'locked', 'slots')
   305 
   311 
   306       if submit:
   312       if submit:
   307         program.slots_allocation = result
   313         program.slots_allocation = result
   308         program.put()
   314         program.put()