|
|
|
|
@ -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 |
|
|
|
|
|