Skip to main content

Dynamically select columns in django admin changelist view with persistence

Project description

django-admin-select-columns

Dynamically select columns in django admin changelist view with persistence

Demo

Demo

Installation

You can install the package via pip:

pip install django-admin-select-columns

Add django_admin_select_columns to INSTALLED_APPS.

INSTALLED_APPS = [
    ...
    "django_admin_select_columns",
    "django.contrib.admin",
    ...
]

The column configuration is stored in the database. Use the migrate command to create the necessary tables.

python manage.py migrate

Usage

Simply add SelectColumnsMixin to your ModelAdmin.

from django.contrib import admin

from django_admin_select_columns.mixins import SelectColumnsMixin
from my_app.models import Person


@admin.register(Person)
class PersonAdmin(SelectColumnsMixin, admin.ModelAdmin):
    list_display = (
        "first_name",
        "last_name",
        "email",
        "phone_number",
        "gender",
        "birthdate",
        "is_active",
    )
    list_filter = ("gender", "is_active")
    search_fields = ("first_name", "last_name", "email", "phone_number")

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_select_columns-1.0.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_admin_select_columns-1.0.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_select_columns-1.0.3.tar.gz.

File metadata

File hashes

Hashes for django_admin_select_columns-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c4c7610f58b552876e14c576128dc3d58aabd1bcc0a3d772961cdb819f325f50
MD5 a1ce3b9917db7b38d4b0f0d6e4efce18
BLAKE2b-256 fac0f22e90bf4d9703d9951f0f029e63345a647f25a2f5552c8ccb9579ec93ee

See more details on using hashes here.

File details

Details for the file django_admin_select_columns-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_select_columns-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 deac174f621625348df2f9f8bc9311731cb6967658f2ef9e4d8ff0e150b9a2d3
MD5 4e36b86d6cc3bbe70a5bf7dfba89356e
BLAKE2b-256 8241df55765a039d245fb859f43a88f065160b0cbf41ab4e5a6d3ed75d9451eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page