django-admin-actions
django-admin-actions provides simple way how to define custom actions for Django admin changelist, changeview and per row in changelist.
Getting started
- Installation
pip install django-admin-actions
pip install git+https://git@github.com/lukasvinclav/django-admin-actions.git
- Add admin_admin_actions into INSTALLED_APPS in your settings file before django.contrib.admin.
Sample admin configuration
from django.contrib import admin
from django.shortcuts import redirect
from django.urls import reverse_lazy
from django.utils.translations import ugettext_lazy as _
from admin_actions.admin import ActionsModelAdmin
from .models import ExampleModel
@admin.register(ExampleModel)
class CustomAdmin(ActionsModelAdmin):
actions_list = ('custom_list_action', )
actions_row = ('custom_row_action', )
actions_detail = ('custom_detail_action', )
def custom_list_action(self, request):
# custom logic here
return redirect(reverse_lazy('admin:APP_MODEL_changelist'))
custom_list_action.short_description = _('Custom name')
custom_list_action.url_path = 'clean-url-path-1'
def custom_row_action(self, request, pk):
# custom logic here
return redirect(reverse_lazy('admin:APP_MODEL_changelist'))
custom_row_action.short_description = _('Row custom name')
custom_row_action.url_path = 'clean-url-path-2'
def custom_detail_action(self, request, pk):
# custom logic here
return redirect(reverse_lazy('admin:APP_MODEL_changelist'))
custom_detail_action.short_description = _('Detail custom name')
custom_detail_action.url_path = 'clean-url-path-3'
Metadata
Release files for django-admin-actions 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-admin-actions-0.1.1.tar.gz | 3.7 kB | Without provenance | Details for django-admin-actions-0.1.1.tar.gz |
Release files / django-admin-actions-0.1.1.tar.gz
| Download URL | django-admin-actions-0.1.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a10875f31b24093a1067c49e880b74da2f4fcc39f8824db0690579b9df0904f
|
|
BLAKE2b-256 checksum How to use checksums |
d1604f1d85a0b63fcb1194bcb5380c76fb9b7e8f2446116d188ea764af5f0d5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5
|
Security for django-admin-actions 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.