1👍
✅
class ActivityAdmin(admin.ModelAdmin):
list_display = [
'title',
'task',
'project',
]
def project(self, obj):
return obj.task.project.name
project.admin_order_field = 'task__project__name'
admin.site.register(Activity, ActivityAdmin)
Source:stackexchange.com