Display correct labels in the admin when get_FIELDNAME_display is used as a readonly field. Re #26
This commit is contained in:
parent
346b8e3f41
commit
76a9df55f5
|
@ -144,6 +144,7 @@ class MultiSelectField(models.CharField):
|
|||
|
||||
def get_display(obj):
|
||||
return ", ".join(get_list(obj))
|
||||
get_display.short_description = self.verbose_name
|
||||
|
||||
setattr(cls, 'get_%s_list' % self.name, get_list)
|
||||
setattr(cls, 'get_%s_display' % self.name, get_display)
|
||||
|
|
Loading…
Reference in a new issue