A reusable Django package to add column toggle functionality in the Django admin interface.
Project description
Django Admin Column Toggle
Django Admin Column Toggle is a reusable Django package that adds column toggle functionality to the Django admin interface. This allows users to show or hide columns in the list view of the Django admin site.
Installation
-
Install the package:
With poetry
poetry add django-admin-column-toggle
With pip
pip install django-admin-column-toggle
-
Add 'column_toggle' to your
INSTALLED_APPS
setting in your Django project:INSTALLED_APPS = [ ... 'column_toggle', ]
Usage
-
Import
ColumnToggleModelAdmin
fromcolumn_toggle.admin
and inherit it in yourModelAdmin
class. For example:from django.contrib import admin from column_toggle.admin import ColumnToggleModelAdmin from .models import YourModel @admin.register(YourModel) class YourModelAdmin(ColumnToggleModelAdmin): list_display = ('field1', 'field2', 'field3')
-
That's it! Now you should have column toggle functionality in the Django admin list view for the specified model.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
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
Built Distribution
Hashes for django_admin_column_toggle-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8499767019dd31269e953b6ff3695207b8f747492eedb9b0d12509c2411f312 |
|
MD5 | c7e40b8df264b0e706e2849cf1bcbf84 |
|
BLAKE2b-256 | ce8c2154a1dcc5d84c7e7450ff3f94b937977f1de5edf0c0c4c2c91af265a705 |
Hashes for django_admin_column_toggle-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d453673d15c156eb77f73f59d7a2056b3415eaa9d880581f0ebdeeeafff45c3 |
|
MD5 | ee8a9347c0f1b27c5415ea94aa0abf7f |
|
BLAKE2b-256 | 015b6da5ede134496c200e46a65cacfe3aef24b5016b4b831dce21ab5183e2f6 |