Django: Converting an entire set of a Model's objects into a single dictionary
You can also rely on django code already written ;).
from django.forms.models import model_to_dict
model_to_dict(instance, fields=[], exclude=[])
You are looking for the Values member of QuerySet which allows you to get a list of dictionaries from your query
Returns a ValuesQuerySet -- a QuerySet that evaluates to a list of dictionaries instead of model-instance objects. Each of those dictionaries represents an object, with the keys corresponding to the attribute names of model objects.
>>> Blog.objects.values()
[{'id': 1, 'name': 'Beatles Blog', 'tagline': 'All the latest Beatles news.'}],
>>> Blog.objects.values('id', 'name')
[{'id': 1, 'name': 'Beatles Blog'}]