1
From the docs, and for the field val
,
class ModelAAdmin(ModelAdmin):
list_display = ['get_val_display']
This should do the job.
[EDIT by OP]
I didn’t succeed to make it work like this but this kind of method was a really good suggestion. Here is how I used this get_FOO_display()
method (and it worked like a charm).
I only modified my ModelA.val()
method :
def val(self):
return self.model_b.get_value_display()
Source:stackexchange.com