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.2.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.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_admin_select_columns-1.0.2.tar.gz
Algorithm Hash digest
SHA256 74d42ff3b4a2a5233d493e0d565a571f0e35b09b6b9dc8d7b57cbdb473bd25ba
MD5 477d36111f3b24a44da68387733c39b4
BLAKE2b-256 c645f1a0fc364c806c88cfcc9588adea1c5334fc56c944384223d72a0e992e24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_select_columns-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 241db854e6305b81cee1fc27308fd9ee9178d9f777671060f5198d7f893f2fd0
MD5 3b1ddbc76b841155874d5eaff57e7433
BLAKE2b-256 940c023f9a8e1675e794a5ec031810da8a032544f55fb8e07b06058792e7adc7

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