Initial draft

This commit is contained in:
CocoByte 2024-11-01 17:37:44 -06:00
parent edfc67649d
commit 9f9147e661
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
3 changed files with 23 additions and 5 deletions

View file

@ -1461,10 +1461,15 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
form = DomainInformationAdminForm
# Customize column header text
@admin.display(description=_("Generic Org Type"))
def converted_generic_org_type(self, obj):
return obj.converted_generic_org_type
# Columns
list_display = [
"domain",
"generic_org_type",
"converted_generic_org_type",
"created_at",
]
@ -1493,7 +1498,7 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
},
),
(".gov domain", {"fields": ["domain"]}),
("Contacts", {"fields": ["senior_official", "other_contacts", "no_other_contacts_rationale"]}),
("Contacts", {"fields": ["generic_org_type", "other_contacts", "no_other_contacts_rationale"]}),
("Background info", {"fields": ["anything_else"]}),
(
"Type of organization",
@ -1611,6 +1616,12 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
# objects rather than Contact objects.
use_sort = db_field.name != "senior_official"
return super().formfield_for_foreignkey(db_field, request, use_admin_sort_fields=use_sort, **kwargs)
def get_queryset(self, request):
qs = super().get_queryset(request)
return qs.annotate(
converted_generic_org_type_display="hey"
)
class DomainRequestResource(FsmModelResource):