Correct keys to be the code name of the fundraiser
This commit is contained in:
		
							parent
							
								
									8df76219f8
								
							
						
					
					
						commit
						4d4f520900
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		|  | @ -13,10 +13,11 @@ def view(request): | ||||||
|     if 'code_name' in GET: codeNames += GET.getlist('code_name') |     if 'code_name' in GET: codeNames += GET.getlist('code_name') | ||||||
| 
 | 
 | ||||||
|     returnDict = {} |     returnDict = {} | ||||||
|     for code in FundraisingGoal.objects.filter(fundraiser_code_name__in=codeNames): |     for fundGoal in FundraisingGoal.objects.filter(fundraiser_code_name__in=codeNames): | ||||||
|         returnDict[code] = {} |         codeName = fundGoal.fundraiser_code_name | ||||||
|  |         returnDict[codeName] = {} | ||||||
|         for kk in keysForJSON: |         for kk in keysForJSON: | ||||||
|             if hasattr(code, kk): |             if hasattr(codeName, kk): | ||||||
|                 returnDict[code][kk] = getattr(code, kk) |                 returnDict[codeName][kk] = getattr(codeName, kk) | ||||||
| 
 | 
 | ||||||
|     return JsonResponse( returnDict) |     return JsonResponse( returnDict) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Bradley M. Kuhn
						Bradley M. Kuhn