django-unfold icon indicating copy to clipboard operation
django-unfold copied to clipboard

Enhance Tab Functionality for URL Query-Based Field Filtering

Open Ehco1996 opened this issue 4 months ago • 6 comments

Summary:

This PR introduces improvements to the tab functionality, allowing tabs to serve as quick filters for field data based on URL query parameters. The current logic does not handle this scenario correctly, leading to incorrect filtering results.

Example:

Currently, the tabs are structured as follows:

tabs = [
    {
        "models": [
            "group1",
        ],
        "items": [
            {"title": "group-1", "link": "/admin/app_name/group/"},
            {"title": "group--2", "link": "/admin/app_name/group/?lable=online"},
        ],
    },
]

This PR addresses the issue by implementing a more robust logic to correctly interpret and apply the URL query parameters for filtering.

Ehco1996 avatar Oct 18 '24 01:10 Ehco1996