Merge pull request #1792 from cisagov/za/1776-domain-and-info-load-faster

Ticket #1776: Domain admin - Improve Domain and Domaininformation load times
This commit is contained in:
zandercymatics 2024-02-26 08:04:10 -07:00 committed by GitHub
commit 30bc9570de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -758,6 +758,14 @@ class DomainInformationAdmin(ListHeaderAdmin):
# to activate the edit/delete/view buttons # to activate the edit/delete/view buttons
filter_horizontal = ("other_contacts",) filter_horizontal = ("other_contacts",)
autocomplete_fields = [
"creator",
"domain_application",
"authorizing_official",
"domain",
"submitter",
]
# Table ordering # Table ordering
ordering = ["domain__name"] ordering = ["domain__name"]
@ -1080,6 +1088,14 @@ class DomainInformationInline(admin.StackedInline):
# to activate the edit/delete/view buttons # to activate the edit/delete/view buttons
filter_horizontal = ("other_contacts",) filter_horizontal = ("other_contacts",)
autocomplete_fields = [
"creator",
"domain_application",
"authorizing_official",
"domain",
"submitter",
]
def formfield_for_manytomany(self, db_field, request, **kwargs): def formfield_for_manytomany(self, db_field, request, **kwargs):
"""customize the behavior of formfields with manytomany relationships. the customized """customize the behavior of formfields with manytomany relationships. the customized
behavior includes sorting of objects in lists as well as customizing helper text""" behavior includes sorting of objects in lists as well as customizing helper text"""