You cannot, values can only retrieve the values ββstored in the database, the string representation is not stored in the database, it is computed in Python.
What can you do:
qs = User.objects.all()
Edit: The second time, depending on how your string representation is calculated, you can use annotate with the query expression to achieve the same result.
source share