From ab9fbb48da5adf1679debb99b0a3153241e8c166 Mon Sep 17 00:00:00 2001 From: "Andreas (@xAndy) Zimmermann" Date: Fri, 26 May 2023 02:03:59 +0200 Subject: [PATCH] display feedback in admin backend --- shiftregister/feedback/admin.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/shiftregister/feedback/admin.py b/shiftregister/feedback/admin.py index 8c38f3f..18061b5 100644 --- a/shiftregister/feedback/admin.py +++ b/shiftregister/feedback/admin.py @@ -1,3 +1,13 @@ from django.contrib import admin -# Register your models here. +from .models import Feedback + + +@admin.register(Feedback) +class FeedbackAdmin(admin.ModelAdmin): + list_display = ("helper", "party", "next_year", "feedback_len") + readonly_fields = ("feedback_len",) + list_filter = ("party", "next_year") + + def feedback_len(self, obj): + return len(obj.feedback_text)