From c37a6a8c1235315edb7f2c0e48d762e4f96500e0 Mon Sep 17 00:00:00 2001 From: Laurent Date: Sun, 5 Oct 2025 20:40:30 +0200 Subject: [PATCH] Adds mobile only filter for prospects --- biz/filters.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/biz/filters.py b/biz/filters.py index 848d376..5714c53 100644 --- a/biz/filters.py +++ b/biz/filters.py @@ -147,6 +147,7 @@ class PhoneFilter(admin.SimpleListFilter): def lookups(self, request, model_admin): return ( ('exclude_mobile', 'Exclude mobile (06/07)'), + ('mobile_only', 'Mobile only (06/07)'), ) def queryset(self, request, queryset): @@ -154,4 +155,9 @@ class PhoneFilter(admin.SimpleListFilter): return queryset.exclude( Q(phone__startswith='06') | Q(phone__startswith='07') ) + elif self.value() == 'mobile_only': + return queryset.filter( + Q(phone__startswith='06') | Q(phone__startswith='07') + ) + return queryset