mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 12:08:40 +02:00
added FederalAgency, updated for using bulk
This commit is contained in:
parent
1921d99eab
commit
97ee855de6
5 changed files with 30 additions and 6 deletions
|
@ -2370,6 +2370,9 @@ class PublicContactResource(resources.ModelResource):
|
|||
|
||||
class Meta:
|
||||
model = models.PublicContact
|
||||
use_bulk = True
|
||||
batch_size = 1000
|
||||
force_init_instance = True
|
||||
|
||||
def __init__(self):
|
||||
"""Sets global variables for code tidyness"""
|
||||
|
@ -2472,11 +2475,20 @@ class VerifiedByStaffAdmin(ListHeaderAdmin):
|
|||
super().save_model(request, obj, form, change)
|
||||
|
||||
|
||||
class FederalAgencyAdmin(ListHeaderAdmin):
|
||||
class FederalAgencyResource(resources.ModelResource):
|
||||
"""defines how each field in the referenced model should be mapped to the corresponding fields in the
|
||||
import/export file"""
|
||||
|
||||
class Meta:
|
||||
model = models.FederalAgency
|
||||
|
||||
|
||||
class FederalAgencyAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
||||
list_display = ["agency"]
|
||||
search_fields = ["agency"]
|
||||
search_help_text = "Search by agency name."
|
||||
ordering = ["agency"]
|
||||
resource_classes = [FederalAgencyResource]
|
||||
|
||||
|
||||
class UserGroupAdmin(AuditedAdmin):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue