I have a query,
name_phonenum = person.objects.value_list('first_name','phone_num')
I want to convert the queryset to a set. Any idea how can do it.
how to convert a QuerySet to a set in django?
1.1k Views Asked by Avishkar Yonjan Tamang At
2
You can wrap it over a
set(…)
:But you can let the database do the work with the
.distinct(…)
method [Django-doc]:this will minimize the bandwidth from the database to the application layer.