I have 3 fields in my Country class in models.py. I then used the following code in admin.py:
from jobs.models import *
from django.contrib import admin
admin.site.register(Country)
admin.site.register(City)
After running manage.py syncdb I logged in to the admin and added a country. On saving it does not show proper name of the country but rather shows “Country Object” in list and drop downs where it is added as foreign key. How does Django determine which field should be shown in listing and select boxes?
This all depends on your
__unicode__method. This defines what is displayed for each model instance in admin listings or foreign key links.