Skip to content

Commit

Permalink
improve admin usability
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Dec 19, 2023
1 parent 2f81d1b commit f9f7829
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions metadata_catalogue/maps/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class SourceAdmin(PolymorphicParentModelAdmin):
child_models = (RasterSource, VectorSource, Source)
list_filter = (PolymorphicChildModelFilter,)

list_display = [
"id",
"name",
"slug",
]


class SourceBaseAdmin(PolymorphicChildModelAdmin):
base_model = Source
Expand All @@ -48,11 +54,25 @@ class SourceBaseAdmin(PolymorphicChildModelAdmin):
class VectorSourceAdmin(SourceBaseAdmin):
base_model = VectorSource

list_display = [
"id",
"name",
"slug",
"protocol",
]


@admin.register(RasterSource)
class RasterSourceAdmin(SourceBaseAdmin):
base_model = RasterSource

list_display = [
"id",
"name",
"slug",
"protocol",
]


@admin.register(Layer)
class LayerAdmin(admin.ModelAdmin):
Expand Down

0 comments on commit f9f7829

Please sign in to comment.