Test sorting

This commit is contained in:
zandercymatics 2023-12-14 14:49:21 -07:00
parent 5e49772ef7
commit e14ebdc2f5
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -549,7 +549,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
# Columns
list_display = [
"requested_domain",
"get_requested_domain",
"status",
"organization_type",
"created_at",
@ -557,6 +557,14 @@ class DomainApplicationAdmin(ListHeaderAdmin):
"investigator",
]
def get_requested_domain(self, obj):
return obj.requested_domain
get_requested_domain.admin_order_field = 'requested_domain__name' # Allows column order sorting
get_requested_domain.short_description = 'Requested Domain' # Sets column's header
ordering = ['requested_domain__name']
# Filters
list_filter = ("status", "organization_type", "investigator")