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.
Note: Once #12090 makes its way into Django admin, this package will hopefully become obsolete!
Install the package:
pip install django-admin-changeform-actionsModify 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 = [...]# Whether to display an `Action: <name>` success message after running
# an action. Disable this if you want to display no message or a custom
# message, e.g. as part of each action.
CHANGEFORM_ACTIONS_ENABLE_DEFAULT_MESSAGE: bool = True
# Enable this to preselect the last action in the dropdown, which is
# helpful to repeatedly run the same action several times.
CHANGEFORM_ACTIONS_REMEMBER_LAST_ACTION: bool = FalseThis project uses uv to handle python versions and dependencies.
uv syncTo do a new release, bump the version in pyproject.toml, then:
uv build
uv publishuv run pytestRun test matrix of different python versions VS different django versions:
uv run tox