I have the following query
country=employees.objects.filter(manager_id__emp_id=111).values('emp_loc').distinct()
I get Output as <QuerySet [{'emp_loc': 'IND'}, {'emp_loc': 'MLA'}]>
But I need list
['IND','MLA']
How Can I do it?
Use values_list
instead.
country=employees.objects.filter(manager_id__emp_id=111).values_list('emp_loc', flat=True).distinct()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With