Skip to content

Commit

Permalink
add import data modeladmin
Browse files Browse the repository at this point in the history
  • Loading branch information
domdinicola committed Jan 16, 2025
1 parent efa3e1f commit aaad9f8
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/hct_mis_api/apps/registration_data/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from hct_mis_api.apps.payment.models import Payment
from hct_mis_api.apps.registration_data.models import (
DeduplicationEngineSimilarityPair,
ImportData,
KoboImportData,
RegistrationDataImport,
)
from hct_mis_api.apps.registration_datahub.celery_tasks import (
Expand Down Expand Up @@ -309,6 +311,37 @@ def enroll_to_program(self, request: HttpRequest, pk: UUID) -> Optional[HttpResp
return TemplateResponse(request, "admin/household/household/enroll_households_to_program.html", context)


@admin.register(ImportData)
class ImportDataAdmin(HOPEModelAdminBase):
list_display = ("business_area_slug", "status", "data_type", "number_of_households", "number_of_individuals")
list_filter = (
"status",
"data_type",
("created_by_id", AutoCompleteFilter),
)


@admin.register(KoboImportData)
class KoboImportDataDataAdmin(HOPEModelAdminBase):
list_display = (
"business_area_slug",
"status",
"data_type",
"kobo_asset_id",
"number_of_households",
"number_of_individuals",
"only_active_submissions",
"pull_pictures",
)
list_filter = (
"status",
"data_type",
("created_by_id", AutoCompleteFilter),
"only_active_submissions",
"pull_pictures",
)


@admin.register(DeduplicationEngineSimilarityPair)
class DeduplicationEngineSimilarityPairAdmin(HOPEModelAdminBase):
list_display = ("program", "individual1", "individual2", "similarity_score")
Expand Down

0 comments on commit aaad9f8

Please sign in to comment.