Skip to content

Commit

Permalink
add admin ui
Browse files Browse the repository at this point in the history
  • Loading branch information
pyDez committed Oct 3, 2024
1 parent 52a3645 commit bd87eaf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions envergo/moulinette/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from envergo.moulinette.models import (
REGULATIONS,
Criterion,
HaieDepartmentConfig,
MoulinetteConfig,
MoulinetteTemplate,
Perimeter,
Expand Down Expand Up @@ -315,3 +316,17 @@ def get_queryset(self, request):
class MoulinetteTemplateAdmin(admin.ModelAdmin):
list_display = ["config", "key"]
search_fields = ["content"]


@admin.register(HaieDepartmentConfig)
class HaieDepartmentConfigAdmin(admin.ModelAdmin):
list_display = ["department", "is_activated", "department_guichet_unique_url"]
list_filter = ["is_activated"]

def get_queryset(self, request):
qs = super().get_queryset(request)
return (
qs.select_related("department")
.order_by("department__department")
.defer("department__geometry")
)

0 comments on commit bd87eaf

Please sign in to comment.