From a8baebe321e37574666532ccf6822c98f2cb82db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Leichtfu=C3=9F?= Date: Fri, 28 May 2021 07:49:02 +0200 Subject: [PATCH] [README] added a hint for the usage of annotation filters --- README.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.rst b/README.rst index 046a45e..d5ecec0 100644 --- a/README.rst +++ b/README.rst @@ -45,8 +45,19 @@ Use the filter classes with your ModelAdmin:: ... list_filter = [ ('myfield', MultiSelectDropdownFilter), + ... ] +Since the ModelAdmin routine to initialize the list filters doesn't work with +annotated attributes the usage for an annotation filter is a little bit special. +The filter class needs to be equipped with the attribute's name:: + + MyModelAdmin(admin.ModelAdmin): + list_filter = [ + BooleanAnnotationFilter.init('my_annotated_attribute'), + ... + ] + Filter classes ==============