Skip to main content

Django admin actions made more generic. Easily create reusable admin actions for common tasks. Provides two usable implementations and an ABC for creating your own implementations.

Project description

django-admin-action-hero

django-admin-action-hero is a library designed to make it easier to create custom repetitive admin actions for Django's admin interface. It provides a simple way to create classes that encapsulate admin actions, allowing for better code reuse and organization.

Installation

To install django-admin-action-hero, you'll use pip install django-admin-action-hero or add django-admin-action-hero to your pyproject.toml or requirements.txt. You don't need to add anything to your INSTALLED_APPS.

Quick example

An example of how to use django-admin-action-hero to create a simple admin action:

from django.contrib import admin

from action_hero.actions import SimpleAction


def my_admin_function(item_pk):
    # Your admin action logic here
    pass


class MyAdmin(admin.ModelAdmin):
    actions = [
        SimpleAction(
            my_admin_function,
            name="my_custom_action",
        ),
    ]

Your MyAdmin class now has a custom admin action called "my_custom_action" that executes my_admin_function for each selected item. You can select the items in the Django admin interface and run the action from the actions dropdown.

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_action_hero-0.1.1.tar.gz (68.3 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_action_hero-0.1.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_action_hero-0.1.1.tar.gz.

File metadata

  • Download URL: django_admin_action_hero-0.1.1.tar.gz
  • Upload date:
  • Size: 68.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_admin_action_hero-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0cf91180179f82ec710339f59cd965822c1a6782a3c1ac5bbb3cb0867ba7028b
MD5 32e9fcf6124b9feb42813ce7ed4a7df1
BLAKE2b-256 4655bf6d4589921d5d07f35a8bf05b550920e1836f9b02b81534e0aa2cbc68de

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_admin_action_hero-0.1.1.tar.gz:

Publisher: publish-to-pypi.yml on kennethlove/django-admin-action-hero

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_admin_action_hero-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_action_hero-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b07c2aa90c6824a0bbae54e66808eabdcc9bec266fded85f44c50accf16ef85a
MD5 9f03d520d4502d1d5c935ab324aaedc6
BLAKE2b-256 eaa620f13787614234aa160bb2d5162b1ee6c7ffa17570c89d5bffaaed5d20c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_admin_action_hero-0.1.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on kennethlove/django-admin-action-hero

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