Skip to content

Commit

Permalink
feat(admin): add filters on the admin models (#41)
Browse files Browse the repository at this point in the history
Add filters on the `dashboards` and `sql_data` admin models. Also change the widget used for selecting `ManyToMany` fields to a more user-friendly one.
  • Loading branch information
kennedykori committed Sep 19, 2022
1 parent 179f3b2 commit 230fece
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/dashboards/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

@admin.register(Dashboard)
class DashboardAdmin(AuditBaseModelAdmin):
filter_horizontal = ("visualizations",)
list_display = ("title", "description", "is_published")


Expand Down
3 changes: 3 additions & 0 deletions apps/sql_data/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class SQLDatabaseSourceAdmin(AuditBaseModelAdmin):

@admin.register(SQLExtractMetadata)
class SQLExtractMetadataAdmin(AuditBaseModelAdmin):
filter_horizontal = ("applicable_source_versions",)
list_display = ("name", "version", "description")
list_filter = ("data_source",)


@admin.register(SQLUploadChunk)
Expand All @@ -45,3 +47,4 @@ class SQLUploadMetadataAdmin(AuditBaseModelAdmin):
"finish_time",
"is_complete",
)
list_filter = ("extract_metadata", "org_unit_code", "org_unit_name")

0 comments on commit 230fece

Please sign in to comment.