PitchHut
Log in / Sign up
django-admin-list-filter
5 views
Streamlined autocompletion for Django admin filters.
Pitch

Django Admin List Filter offers a straightforward solution to enhance your admin interface. By integrating autocompletion with Django's native features, it simplifies list filtering, making data management more efficient. This upgraded tool, built for Django 5 and above, requires no additional installations, allowing you to focus on what matters.

Description

Django Admin List Filter is a powerful and straightforward autocompletion tool for Django's list_filter, designed to enhance your Django admin experience with minimal configuration. Built on popular libraries like select2 and jquery, this package leverages Django’s built-in features and integrates seamlessly via AutocompleteJsonView.

Originally an enhancement of the deprecated django-admin-autocomplete-list-filter, Django Admin List Filter supports Django version 5 and later, eliminating the need for any additional packages or installation steps.

Key Features:

  • Instant Filtering: Enjoy real-time autocompletion for your Django admin list filters, making data navigation smooth and efficient.
  • Easy Integration: Add just one import and a simple configuration to your existing Django admin setups.
  • No Dependencies: Works out of the box with Django's built-in functionality, offering a hassle-free experience.

Before and After:

Before Django Admin List Filter
Before Django Admin List Filter

After Django Admin List Filter
After Django Admin List Filter

Usage Example

Integrating the DALFModelAdmin into your admin interface is straightforward. Here’s a basic example:

# admin.py
from dalf.admin import DALFModelAdmin, DALFRelatedFieldAjax, DALFRelatedOnlyField
from django.contrib import admin
from YOURAPP.models import Post

@admin.register(Post)
class PostAdmin(DALFModelAdmin):
    list_filter = (
        ('author', DALFRelatedOnlyField),    # includes only authors with posts
        ('category', DALFRelatedFieldAjax),  # Enables AJAX completion for category
        ('tags', DALFRelatedFieldAjax),      # Enables AJAX completion for tags
    )

Development and Contributions

This project encourages collaboration! To contribute, simply fork the repository and submit your pull requests. Your help not only helps improve the package but enhances its usability for all users.

Django Admin List Filter aims to provide a fast, user-friendly admin interface for Django applications, ensuring a pleasant experience while administering your content. Get started today and transform the way you manage your Django models!