I\'m trying to pass a Query Set from Django to a template with javascript.
I\'ve tried different approaches to solve this:
1. Normal Approach - Javas
For me to send the whole QuerySet (while preserving the fields names; sending object
not list
). I used the following
# views.py
units = Unit.objects.all()
units_serialized = serializers.serialize('json', units)
context['units'] = units_serialized
and just use safe
tag in the template
# template.html