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.4.tar.gz (11.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_generic_admin_actions-0.4-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

File details

Details for the file django_generic_admin_actions-0.4.tar.gz.

File metadata

File hashes

Hashes for django_generic_admin_actions-0.4.tar.gz
Algorithm Hash digest
SHA256 e76826162eb5bf80301eaa37180994983cf9767244b5ad23ddfcf78490fb05b3
MD5 5675176d353ef9028a5026cfbfbf16bb
BLAKE2b-256 9653506f7093bb1bc7264b89b8102509a74ca89bfcf97525f75842d5186af1db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_generic_admin_actions-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f0fd3ea7994f6c618f86ec2f9b89bc694e424091b030ba362af20fb1144bf8dc
MD5 13ad303b92d0213c0d4f7b2562f9df60
BLAKE2b-256 5742783fe6254f23eb579f2fee204e93fc1c2ae35a28bb5979e867834304c487

See more details on using hashes here.

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