Let's say I have a field called field
in my model, with a choices
parameter defining the values to be returned by the get_field_display
method.
I need the get_field_display
method to return a different value based on another field. Is there any way to override get_field_display
?
This doesn't work:
def get_field_display(self):
if self.other_field == 1:
return 'Other value'
return super.get_field_display(self)