diff mbox series

[7/9] admin: Add Note admin

Message ID 20240313065642.385843-7-andrepapoti@gmail.com
State New
Headers show
Series [1/9] models: Add Note model | expand

Commit Message

andrepapoti March 13, 2024, 6:56 a.m. UTC
Signed-off-by: andrepapoti <andrepapoti@gmail.com>
---
 patchwork/admin.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/patchwork/admin.py b/patchwork/admin.py
index d3bf8d2..6ac9183 100644
--- a/patchwork/admin.py
+++ b/patchwork/admin.py
@@ -13,6 +13,7 @@  from patchwork.models import Check
 from patchwork.models import Cover
 from patchwork.models import CoverComment
 from patchwork.models import DelegationRule
+from patchwork.models import Note
 from patchwork.models import Patch
 from patchwork.models import PatchComment
 from patchwork.models import PatchRelation
@@ -130,6 +131,15 @@  class PatchCommentAdmin(admin.ModelAdmin):
 admin.site.register(PatchComment, PatchCommentAdmin)
 
 
+class NoteAdmin(admin.ModelAdmin):
+    list_display = ('patch', 'submitter', 'last_modified')
+    search_fields = ('patch__name', 'submitter__name', 'submitter__email')
+    date_hierarchy = 'last_modified'
+
+
+admin.site.register(Note, NoteAdmin)
+
+
 class PatchInline(admin.StackedInline):
     model = Patch
     extra = 0