Metadata-Version: 2.4
Name: django-grouped-admin-actions
Version: 1.0
Summary: Improve your admin action dropdown by using option groups.
Author-email: Thomas Leichtfuß <thomas.leichtfuss@posteo.de>
License: BSD License
Project-URL: Homepage, https://github.com/thomst/django-grouped-admin-actions
Project-URL: Repository, https://github.com/thomst/django-grouped-admin-actions
Project-URL: Documentation, https://github.com/thomst/django-grouped-admin-actions#readme
Classifier: Framework :: Django
Classifier: Framework :: Django :: 2.2
Classifier: Framework :: Django :: 3.0
Classifier: Framework :: Django :: 3.1
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
Requires-Dist: Django>=2.2

=======================================
Welcome to django-grouped-admin-actions
=======================================

.. image:: https://github.com/thomst/django-grouped-admin-actions/actions/workflows/tests.yml/badge.svg
   :target: https://github.com/thomst/django-grouped-admin-actions/actions/workflows/tests.yml
   :alt: Run tests for django-grouped-admin-actions

.. image:: https://coveralls.io/repos/github/thomst/django-grouped-admin-actions/badge.svg?branch=main
   :target: https://coveralls.io/github/thomst/django-grouped-admin-actions?branch=main
   :alt: coveralls badge

.. image:: https://img.shields.io/badge/python-3.8+-blue
   :target: https://img.shields.io/badge/python-3.8+-blue
   :alt: python: 3.8+

.. image:: https://img.shields.io/badge/django-2.2%20%7C%203.0%20%7C%203.1%20%7C%203.2%20%7C%204.0%20%7C%204.1%20%7C%204.2%20%7C%205.0%20%7C%205.1%20%7C%205.2%20%7C%206.0-orange
   :target: https://img.shields.io/badge/django-2.2%20%7C%203.0%20%7C%203.1%20%7C%203.2%20%7C%204.0%20%7C%204.1%20%7C%204.2%20%7C%205.0%20%7C%205.1%20%7C%205.2%20%7C%206.0-orange
   :alt: 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.
