Skip to main content

Improve your admin action dropdown by using option groups.

Project description

Run tests for django-grouped-admin-actions coveralls badge python: 3.8+ django: 2.2, 3.0, 3.1, 3.2, 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 6.0

Description

Improve the usability of your admin action dropdown by using option groups and the action’s docstrings as title tags.

Installation

Install from pypi.org:

pip install django-grouped-admin-actions

Usage

Use the GroupedAdminActionsMixin in your ModelAdmin classes:

from django.contrib import admin
from grouped_admin_actions.admin import GroupedAdminActionsMixin
from .models import YourModel

@admin.register(YourModel)
class YourModelAdmin(GroupedAdminActionsMixin, admin.ModelAdmin):
    actions = [
        'action_one',
        'action_two',
        'action_three',
        ...
    ]

Setup your admin actions with meaningful docstrings and use action groups as decorator:

from grouped_admin_actions.admin import action_group

group_one = ActionGroup("Action 1")
group_two = ActionGroup("Action 2")

@group_one
def action_one(modeladmin, request, queryset):
    """This is action one in group 1."""
    ...

@group_one
def action_two(modeladmin, request, queryset):
    """This is action two in group 1."""
    ...

@group_two
def action_three(modeladmin, request, queryset):
    """This is action three in group 2."""
    ...

Now you get a grouped action dropdown in your dango admin changelist views with the action’s docstring as title tag of each option.

Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

django_grouped_admin_actions-1.0.tar.gz (3.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_grouped_admin_actions-1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file django_grouped_admin_actions-1.0.tar.gz.

File metadata

File hashes

Hashes for django_grouped_admin_actions-1.0.tar.gz
Algorithm Hash digest
SHA256 577ec4c8a3c5ddb025bc7c4a2d32f0810ac4958d6684dc8325109eb1aa9f49bf
MD5 559200df39c3e63ed9c0f3e0ae365641
BLAKE2b-256 bfd01002344f13b74c76efe2f1e2d68c5cce2d410499457e1546002fd0cbe16f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_grouped_admin_actions-1.0.tar.gz:

Publisher: publish.yml on thomst/django-grouped-admin-actions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_grouped_admin_actions-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_grouped_admin_actions-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd4cc9d803d291be4e1c69af050def9ef35e248f4d6bcb989cf1fdac2c161736
MD5 f6b3796d9333dce60f5fd998feb9981f
BLAKE2b-256 3b8725931b49bae173448eaed4d34a75d85e8194e72efd803bf3e94e4e1eba25

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_grouped_admin_actions-1.0-py3-none-any.whl:

Publisher: publish.yml on thomst/django-grouped-admin-actions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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