1π
β
I think I understand your question. You seem to be expecting values_list
to return the __unicode__
of a related model, but thereβs no reason to think it would: as the name implies, it returns the values only, and the value of a ForeignKey field is just the ID.
You can supply a list of fieldnames to values_list
and traverse the relationship there, if you want:
Expenditure.objects.values_list('description', 'amount', 'exp_type__ Expenditure_Type')
π€Daniel Roseman
Source:stackexchange.com