You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

django-admin-select-columns

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-admin-select-columns

Dynamically select columns in django admin changelist view with persistence

1.0.3
pipPyPI
Maintainers
1

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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts