Automatically generates Django admin actions based on your model's fields
Project description
Django Auto Actions
Automatically generates Django admin actions based on your model's fields
Installation
Install the package using pip
pip install django-auto-actions
Usage
There are two ways to integrate django-auto-actions into your Django admin
Using AutoActionsModelAdmin
from django_auto_actions import AutoActionsModelAdmin
@admin.register(YourModel)
class YourModelAdmin(AutoActionsModelAdmin):
...
or Using the mixin (AutoActionsMixin)
from django.contrib.admin import ModelAdmin
from django_auto_actions import AutoActionsMixin
@admin.register(YourModel)
class YourModelAdmin(AutoActionsMixin, ModelAdmin):
...
This will automatically create admin actions for your model's BooleanFields, DateTimeFields, DateFields and TimeFields. if you don't want auto-action on certain fields, you can define the exclude_auto_actions
attribute.
@admin.register(YourModel)
class YourModelAdmin(AutoActionsMixin, ModelAdmin):
exclude_auto_actions = ["is_example", "created_at"]
Here's an example of what it might look like:
- TODO: Add a screenshot here :)
Support & Contributing
Please consider giving the project a star. Your PRs are welcome!
Authors
- Félix Gravel — @Flexonze
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file django_auto_actions-0.1.0.tar.gz
.
File metadata
- Download URL: django_auto_actions-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37e289048a58fa093c002e903398d2ff9c21ff9c9fd932cbc97394781f3a59fb |
|
MD5 | 97af12591fced1f3e740a7983e010d24 |
|
BLAKE2b-256 | bbc572d27cccda5d67bb47d482358f4c53c58c4c1fbe557cb5b74ca1148b66c9 |
File details
Details for the file django_auto_actions-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: django_auto_actions-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b507a404a731cfd9ba3909277a67a7ebf3ab2cae92fa51d3e0c36cc3f55cadab |
|
MD5 | 31643974cbf8d2d0a7d336e283900562 |
|
BLAKE2b-256 | 4ecdb35d028c585a0bc85c1ab069641a28f8ff76e700f618de50ebb8c89bd1ba |