Reuse model admin changelist actions on changeform pages
Project description
django-admin-changeform-actions
Replicates the admin
actions
dropdown (available on a model's changelist page) on each model
instance's changeform page.
Instead of targetting a selection the action will target the current model instance only.
Installation
Install the package:
pip install django-admin-changeform-actions
Modify your Django project like:
# settings.py
INSTALLED_APPS = [
"changeform_actions", # Must be placed before Django's admin app!
...
"django.contrib.admin",
]
# urls.py
urlpatterns = [
path("", include("changeform_actions.urls"))
]
# admin.py
from changeform_actions import ChangeFormActionsMixin
class MyModelAdmin(ChangeFormActionsMixin, admin.ModelAdmin):
actions = [...]
Development Setup
This project uses uv to handle python versions and dependencies.
uv sync
To do a new release, bump the version in pyproject.toml, then:
uv build
uv publish
Tests
uv run pytest
Run test matrix of different python versions VS different django versions:
uv run tox
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_admin_changeform_actions-0.5.3.tar.gz.
File metadata
- Download URL: django_admin_changeform_actions-0.5.3.tar.gz
- Upload date:
- Size: 59.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34894a1164bda7d25a154477125f42ae0980f8654040d84bd26fd4d930f77c7a
|
|
| MD5 |
16cebf31f87a0e375b0231127484d268
|
|
| BLAKE2b-256 |
e56c1f9e2fd3a5ced20ad6c51bb5b086d7cb40b2309c9e333c82d5cd37f95a4f
|
File details
Details for the file django_admin_changeform_actions-0.5.3-py3-none-any.whl.
File metadata
- Download URL: django_admin_changeform_actions-0.5.3-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c3f3897d675e96aafd584e2dc0269e0e6b55308b13005f3f9354ae69642fc8c
|
|
| MD5 |
5ea26828816c67031f7c494a0de0b059
|
|
| BLAKE2b-256 |
4d11103fca63f554ac3ff0b12e003293b36f89284a2f38ea96fe6c74f51e8080
|