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",
    ...
]

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.1.tar.gz (4.8 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.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_admin_select_columns-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c58073f11a9039b5eabced09c73dac92dc257773fc7fdb4b0fb15ed0f05df2bb
MD5 df5692ab3a8bd1fd8e8bd874077e0956
BLAKE2b-256 f83c5b20685b86ba1487deffefb584212d3a82a3379b49f3567a501fea3ea114

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_select_columns-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2dd5118e242226d943ab2bc149395af0522d85c8474464fc23829469bb3553c
MD5 c24040e2edfb5d0d304efa89eece4416
BLAKE2b-256 f9abbc4b5b239f06bc68be493ca000389c83ccd8b8175d15c1678fee3cb63faf

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