[Django]-ModelAdmin, foreign key relation chain

6👍

See this answer:

You can create a method on your McAdmin class that returns these nested Foreign Key values:

class McAdmin(admin.modelAdmin):
    list_display = ('name', 'get_email_foreign_foreign_key')

    def get_email_foreign_foreign_key(self, obj):
        return '%s' % obj.fc.fb.fa

Leave a comment