I get 'Pixel' object does not support item assignment
How can I append additional dictionary to my pixel_list objects?
def pixel_main(request, page):
y = int(page) * 10
x = y - 10
pixel_list = Pixel.objects.all()[x:y]
for i in pixel_list:
if Handler.objects.filter(pixel=i.id).filter(user=request.user):
i['vote'] = True
else:
i['vote'] = False
return render_to_response('pixel_main.html', {"pixels": pixel_list}, context_instance=RequestContext(request))
Python lets you add attributes to object instances using dot notation: