django / django/new-features

Django Admin - Categorizing list_filter

Open
#205 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
188
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] I agree to follow Django's Code of Conduct

### Feature Description

Idea is to be able to categorize list_filter, so filter can be grouped.

At moment it's just a list order dependend bunch of fields.

### Problem

At moment it's just a list order dependend bunch of fields.

On tables with many filters a specific filter is hard to be found, or will be overseen easily.

### Request or proposal

request

### Additional Details

_No response_

### Implementation Suggestions

I think a structure similar to fieldset grouping would be the best way.

For backward compatbility this should be an optional feature.

-> if a list_filter Element is a list or tuple, it's not a field, it's a categorized filter group

Implementation thought for django admin:

```
def get_list_filter(self, request):
return (
('Category A', {
fields: ['filter_a', 'filter_b', 'filter_c']}
),
('Category B', {
fields: ['filter_d', 'filter_e', 'filter_f']}
)
)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing Django admin's get_list_filter/list_filter handling and compare it with the existing fieldset grouping behavior. Clarify the grouping structure, how it preserves the current list_filter format, and what admin rendering and tests would need to demonstrate that grouped filters work without breaking ungrouped filters.

Written by the indexing model from the issue text.

Assessment

Tech stack
django
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.