Proposal data is now stored in a list rather then a dictionary for the AssignedProposals JSON object.
authorLennard de Rijk <ljvderijk@gmail.com>
Tue, 17 Mar 2009 22:03:00 +0000
changeset 1919 1ec857439499
parent 1918 77c726b96916
child 1920 0eba9cb1b331
Proposal data is now stored in a list rather then a dictionary for the AssignedProposals JSON object. As requested by Mario. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/views/models/program.py
--- a/app/soc/views/models/program.py	Tue Mar 17 20:51:07 2009 +0000
+++ b/app/soc/views/models/program.py	Tue Mar 17 22:03:00 2009 +0000
@@ -411,7 +411,7 @@
     org_entities = org_logic.logic.getForFields(fields, limit=limit, offset=offset)
 
     orgs_data = {}
-    proposals_data = {}
+    proposals_data = []
 
     # for each org get the proposals who will be assigned a slot
     for org in org_entities:
@@ -457,13 +457,14 @@
       for proposal in student_proposal_entities:
         student_entity = proposal.scope
 
-        proposals_data[proposal.key().name()] = {
+        proposals_data.append(
+            {'key_name': proposal.key().name(),
             'proposal_title': proposal.title,
             'student_key': student_entity.key().name(),
             'student_name': student_entity.name(),
             'student_contact': student_entity.email,
             'org_key': org.key().name()
-            }
+            })
 
     # return all the data in JSON format
     data = {'orgs': orgs_data,