mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-20 09:46:06 +02:00
Add some timing
This commit is contained in:
parent
a51949da0b
commit
ee41a8ac73
1 changed files with 47 additions and 37 deletions
|
@ -205,9 +205,13 @@ class ListHeaderAdmin(AuditedAdmin, OrderableFieldsMixin):
|
|||
|
||||
Reference: https://code.djangoproject.com/ticket/31975
|
||||
"""
|
||||
logger.info("timing get_changelist")
|
||||
with Timer() as t:
|
||||
return MultiFieldSortableChangeList
|
||||
|
||||
def changelist_view(self, request, extra_context=None):
|
||||
logger.info("timing changelist_view")
|
||||
with Timer() as t:
|
||||
if extra_context is None:
|
||||
extra_context = {}
|
||||
# Get the filtered values
|
||||
|
@ -224,7 +228,8 @@ class ListHeaderAdmin(AuditedAdmin, OrderableFieldsMixin):
|
|||
parameter_value: string}
|
||||
TODO: convert investigator id to investigator username
|
||||
"""
|
||||
|
||||
logger.info("timing get_filters")
|
||||
with Timer() as t:
|
||||
filters = []
|
||||
# Retrieve the filter parameters
|
||||
for param in request.GET.keys():
|
||||
|
@ -803,6 +808,11 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
else:
|
||||
return queryset.filter(investigator__id__exact=self.value())
|
||||
|
||||
def __new__(self, *args, **kwargs):
|
||||
logger.info("timing __new__")
|
||||
with Timer() as t:
|
||||
return super().__new__(self, *args, **kwargs)
|
||||
|
||||
# Columns
|
||||
list_display = [
|
||||
"requested_domain",
|
||||
|
@ -905,7 +915,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
def formfield_for_manytomany(self, db_field, request, **kwargs):
|
||||
logger.info("timing formfield_for_manytomany")
|
||||
with Timer() as t:
|
||||
if db_field.name in ("current_websites", "alternative_domains"):
|
||||
if db_field.name in {"current_websites", "alternative_domains"}:
|
||||
kwargs["queryset"] = models.Website.objects.all().order_by("website") # Sort websites
|
||||
return super().formfield_for_manytomany(db_field, request, **kwargs)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue