I'm trying to convert my dict to a list of string. this is what generated by django froms list of student
I want to have a list without the {''} My forms :
students= ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple(
attrs={'class': 'displaynone'}),
queryset=Student.objects.exclude(present=True).order_by(
'name').values('name'),
required=False,
label="Choice Students"
)
and template
{% for i in form.students %}
{{ i }}
{% endfor %}
and I know I can juste do queryset=Student.objects.exclude(present=True).order_by('name')
without the values() but I juste want to retreive the name. It will optimize the load of my page.
