Here is a snippet of models.py
class Applicant(models.Model):
name = models.CharField(...)
email = models.CharField(...)
class Application(models.Model):
applicant = models.ForeignKey(Applicant)
text = models.TextField(...)
Here is my admin.py:
class ApplicationAdmin(model.ModelAdmin):
list_display = ['text', *******]
admin.site.register(Application, ApplicationAdmin)
In the ApplicationAdmin I want to present the Applicants name and email.
What have you tried before asking SO?
I have looked at the following code, which does not work:
list_display = ['text', 'applicant__name','applicant__email']
I have looked at ModelAdmin.inlines but as one can see, the parent/child relationship have to be reversed.
Any suggestions? How can I display an applicants name/email in Applications admin. Prefferably without migrating the database with new fields etc.