Fix RangeNameTranslationAdmin

This commit is contained in:
PCoder 2021-11-11 22:59:02 +05:30
parent 6f9ca6961c
commit 76f714a257

View file

@ -96,7 +96,15 @@ class TaxonRangeAdmin(admin.ModelAdmin):
class RangeNameTranslationAdmin(admin.ModelAdmin):
search_fields = ['range_name_translation']
model = RangeNameTranslation
search_fields = ['range__range_name', 'language__language']
list_display = ['range_name', 'language_translation']
def range_name(self, obj):
return str(obj.range.range_name)
def country_name(self, obj):
return str(obj.language.language) if obj.language else 'None'
class PeopleRangeAdmin(admin.ModelAdmin):