Skip to main content

Reuse model admin changelist actions on changeform pages

Project description

django-admin-changeform-actions

Run pytest Run tox

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.4.tar.gz (59.7 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.4.tar.gz.

File metadata

File hashes

Hashes for django_admin_changeform_actions-0.5.4.tar.gz
Algorithm Hash digest
SHA256 6949720a8d60f6bb264412629b285fc6762706fd838dc26e320756b13229cc4e
MD5 57505210b713a68a8f9d6457f445419b
BLAKE2b-256 3a2bc5ae1d4095a554ed8d8703fe6e96b85cda4f0d2c8e6ab8f4bf069adbb047

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_admin_changeform_actions-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1fb4976ad393143fb18d99b9567def29319772488471b5a2288527640d037b65
MD5 df2d2578b5188c0a958d45db8096aff3
BLAKE2b-256 fc44ed29fad27106e2e89f5178b79ec1c155a3918f1da5f86ac9fbcf972e63dd

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