Skip to main content

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

django_admin_changeform_actions-0.5.3.tar.gz (59.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django_admin_changeform_actions-0.5.3.tar.gz.

File metadata

File hashes

Hashes for django_admin_changeform_actions-0.5.3.tar.gz
Algorithm Hash digest
SHA256 34894a1164bda7d25a154477125f42ae0980f8654040d84bd26fd4d930f77c7a
MD5 16cebf31f87a0e375b0231127484d268
BLAKE2b-256 e56c1f9e2fd3a5ced20ad6c51bb5b086d7cb40b2309c9e333c82d5cd37f95a4f

See more details on using hashes here.

File details

Details for the file django_admin_changeform_actions-0.5.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_changeform_actions-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6c3f3897d675e96aafd584e2dc0269e0e6b55308b13005f3f9354ae69642fc8c
MD5 5ea26828816c67031f7c494a0de0b059
BLAKE2b-256 4d11103fca63f554ac3ff0b12e003293b36f89284a2f38ea96fe6c74f51e8080

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