diff --git a/app/access/admin.py b/app/access/admin.py index d3057e3..0188962 100644 --- a/app/access/admin.py +++ b/app/access/admin.py @@ -8,8 +8,9 @@ @admin.register(User) class UserAdmin(admin.ModelAdmin): # type:ignore[type-arg] '''Admin View for User''' - list_display = ('provider', 'username', 'deleted_at') - actions = ["disable"] + list_display = ('username', 'deleted_at', 'provider') + list_filter = ('deleted_at', ('provider', admin.RelatedOnlyFieldListFilter)) + actions = ('disable',) @admin.action(description="Disable selected users") def disable(self, request: HttpRequest, queryset: models.QuerySet[User]) -> None: diff --git a/app/distributions/admin.py b/app/distributions/admin.py index ab040c9..05ea5a3 100644 --- a/app/distributions/admin.py +++ b/app/distributions/admin.py @@ -8,7 +8,13 @@ class AttributionAdmin(admin.ModelAdmin): # type:ignore[type-arg] '''Admin View for Attribution''' + list_display = ('name_en', 'provider') + list_filter = (('provider', admin.RelatedOnlyFieldListFilter),) + @admin.register(Dataset) class DatasetAdmin(admin.ModelAdmin): # type:ignore[type-arg] '''Admin View for Dataset''' + + list_display = ('slug', 'provider') + list_filter = (('provider', admin.RelatedOnlyFieldListFilter),) diff --git a/app/provider/admin.py b/app/provider/admin.py index b04a1a7..9fadf90 100644 --- a/app/provider/admin.py +++ b/app/provider/admin.py @@ -6,3 +6,5 @@ @admin.register(Provider) class ProviderAdmin(admin.ModelAdmin): # type:ignore[type-arg] '''Admin View for Provider''' + + list_display = ('acronym_en', 'name_en') diff --git a/app/provider/models.py b/app/provider/models.py index fe78f0b..62f467b 100644 --- a/app/provider/models.py +++ b/app/provider/models.py @@ -7,7 +7,7 @@ class Provider(models.Model): _context = "Provider model" def __str__(self) -> str: - return str(self.name_en) + return str(self.acronym_en) ''' Note: The "blank=False" for a model field doesn't prevent DB changes.