Optimize MountainRange admin page load time

This commit is contained in:
PCoder 2022-01-05 21:02:12 +05:30
parent 77f8d6da89
commit ca20e1490e

View file

@ -132,11 +132,15 @@ class ResourceAdmin(admin.ModelAdmin):
class RangeNameTranslationInline(admin.TabularInline):
autocomplete_fields = ['language_translation']
model = RangeNameTranslation
extra = 0
class RangeCountryInline(admin.TabularInline):
autocomplete_fields = ['country']
model = RangeCountry
extra = 0
class RangeAdmin(admin.ModelAdmin):
@ -179,6 +183,7 @@ class RangeAdmin(admin.ModelAdmin):
)
list_display = ['range_name', 'mother_range', 'countries']
ordering = ['range_name']
list_per_page = settings.ADMIN_LIST_PER_PAGE
class PeopleOrganizationInline(admin.TabularInline):
@ -390,9 +395,9 @@ admin.site.register(Keyword, KeywordAdmin)
# LU models
# admin.site.register(Country, CountriesAdmin)
admin.site.register(Country, CountriesAdmin)
# admin.site.register(GMBA_SpeciesGroup, GMBA_SpeciesGroupAdmin)
# admin.site.register(Language, LanguageAdmin)
admin.site.register(Language, LanguageAdmin)
# admin.site.register(PeopleStatus, PeopleStatusAdmin)
# admin.site.register(RangeType, RangeTypeAdmin)
# admin.site.register(RedListCategory, RedListCategoryAdmin)