Skip to content

Commit

Permalink
✨ [#76] added document action fields to the documents admin, and rest…
Browse files Browse the repository at this point in the history
…ructured the layout.
  • Loading branch information
bart-maykin committed Nov 13, 2024
1 parent d4764cf commit 34d0b26
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/woo_publications/publications/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,47 @@ class DocumentAdmin(AdminAuditLogMixin, admin.ModelAdmin):
"registratiedatum",
"show_actions",
)
fieldsets = [
(
None,
{
"fields": (
"publicatie",
"identifier",
"officiele_titel",
"verkorte_titel",
"omschrijving",
"creatiedatum",
"bestandsformaat",
"bestandsnaam",
"bestandsomvang",
"publicatiestatus",
"registratiedatum",
"laatst_gewijzigd_datum",
"uuid",
)
},
),
(
_("Document Action Fields"),
{"fields": ("soort_handeling", "vanaf", "was_geassocieerd_met")},
),
(
_("Documents API integration Fields"),
{
"fields": (
"document_service",
"document_uuid",
"lock",
)
},
),
]
readonly_fields = (
"uuid",
"registratiedatum",
"laatst_gewijzigd_datum",
"was_geassocieerd_met",
)
search_fields = (
"identifier",
Expand Down Expand Up @@ -122,3 +159,6 @@ def show_actions(self, obj: Document) -> str:
'<a href="{}">{}</a>',
actions,
)

def was_geassocieerd_met(self, obj: Document) -> str:
return obj.publicatie.verantwoordelijke

0 comments on commit 34d0b26

Please sign in to comment.