Changeset - 4d4f5209008f
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 6 years ago 2015-05-10 00:31:47
bkuhn@ebb.org
Correct keys to be the code name of the fundraiser
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/fundgoal/views.py
Show inline comments
...
 
@@ -13,10 +13,11 @@ def view(request):
 
    if 'code_name' in GET: codeNames += GET.getlist('code_name')
 

	
 
    returnDict = {}
 
    for code in FundraisingGoal.objects.filter(fundraiser_code_name__in=codeNames):
 
        returnDict[code] = {}
 
    for fundGoal in FundraisingGoal.objects.filter(fundraiser_code_name__in=codeNames):
 
        codeName = fundGoal.fundraiser_code_name
 
        returnDict[codeName] = {}
 
        for kk in keysForJSON:
 
            if hasattr(code, kk):
 
                returnDict[code][kk] = getattr(code, kk)
 
            if hasattr(codeName, kk):
 
                returnDict[codeName][kk] = getattr(codeName, kk)
 

	
 
    return JsonResponse( returnDict)
0 comments (0 inline, 0 general)