Skip to main content

TODO

Project description

Run tests for django-generic-admin-actions coveralls badge python: 3.7, 3.8, 3.9,3.9,3.10 django: 2.2, 3.0, 3.1, 3.2, 4.0, 4.1, 4.2

Description

Django-generic-admin-actions are admin actions without an item selection. They work exactly like original admin actions but without taking a queryset. This is useful for actions that are model (and not object) related or that should manipulate model objects as a whole.

Installation

Install from pypi.org:

pip install django-generic-admin-actions

Getting started

Add generic_admin_actions to your installed apps:

INSTALLED_APPS = [
    'generic_admin_actions',
    'django.contrib.admin',
    ...
]

Since we overwrite the change_list.html template the app must be listed before django’s admin-site.

Use the GenericActionsMixin for your ModelAdmin classes and add some actions:

from django.contrib import admin
from generic_admin_actions import GenericActionsMixin

def my_action(modeladmin, request):
    # Do some stuff here.

class MyModelAdmin(GenericActionsMixin, admin.ModelAdmin):
    ...
    generic_actions = [
        my_action,
        ...
    ]

Generic admin actions working all the same as original admin actions with the difference that their don’t take a queryset. So for more advanced setups like actions with intermediate pages please follow django’s official documentation.

Usage

On your model’s change-list-view choose the generic action from the dropdown and press the “Go” button.

Download files

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

Source Distribution

django-generic-admin-actions-0.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-generic-admin-actions-0.3.tar.gz.

File metadata

File hashes

Hashes for django-generic-admin-actions-0.3.tar.gz
Algorithm Hash digest
SHA256 1ead5a7137c2b26a942d1c5f3c2c66750039aec526a947c77b1b68691c55a15d
MD5 c7a9094ef9c86ede8151780a3d13c215
BLAKE2b-256 909c25b5afc15690aec4c19ab82fb87c1146f5ad481a5fd499116f9548b9821b

See more details on using hashes here.

Provenance

File details

Details for the file django_generic_admin_actions-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_generic_admin_actions-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bd59686e6dd84d25fc60b2bcb354f0a58e5d97e77da07752a2ca9b1d9a4adc05
MD5 aed408dd9e9d2a9d19e970f9e6e1ba71
BLAKE2b-256 0dea117265d9d228d76539586b1c80a77d9ebbfd4ff45eb1e05f02e316ed2dfb

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page