mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-24 11:38:39 +02:00
Initial draft
This commit is contained in:
parent
edfc67649d
commit
9f9147e661
3 changed files with 23 additions and 5 deletions
|
@ -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):
|
||||
|
|
|
@ -2078,4 +2078,4 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
if property in self._cache:
|
||||
return self._cache[property]
|
||||
else:
|
||||
raise KeyError("Requested key %s was not found in registry cache." % str(property))
|
||||
raise KeyError("Requested key %s was not found in registry cache." % str(property))
|
|
@ -426,13 +426,14 @@ class DomainInformation(TimeStampedModel):
|
|||
else:
|
||||
return None
|
||||
|
||||
# ----- Portfolio Properties -----
|
||||
|
||||
@property
|
||||
def converted_organization_name(self):
|
||||
if self.portfolio:
|
||||
return self.portfolio.organization_name
|
||||
return self.organization_name
|
||||
|
||||
# ----- Portfolio Properties -----
|
||||
@property
|
||||
def converted_generic_org_type(self):
|
||||
if self.portfolio:
|
||||
|
@ -474,7 +475,7 @@ class DomainInformation(TimeStampedModel):
|
|||
if self.portfolio:
|
||||
return self.portfolio.city
|
||||
return self.city
|
||||
|
||||
|
||||
@property
|
||||
def converted_state_territory(self):
|
||||
if self.portfolio:
|
||||
|
@ -492,3 +493,9 @@ class DomainInformation(TimeStampedModel):
|
|||
if self.portfolio:
|
||||
return self.portfolio.urbanization
|
||||
return self.urbanization
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue