How to display/retrieve foreign key value as a string and not id

I am using User from django.contrib.auth.models as a foreign key in different tables.

Wonder if there is a simple way to display the username in the forms instead of having a list of id’s. Also, a little help on how to make a query to retrieve other values in the table for a specific user.username (not id) would be much appreciated.

Thank you for your time in advance.

It’s possible to do that.

For example, if using a queryset: Model.objects.filter().values_list(‘user__first_name’,…)

If an object:
obj = Model.object.get(pk=1)
print(obj.user.first_name)

Take a look here

Maybe you paste want to paste your code here and we can help you more.