Skip to main content

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

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_auto_actions-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

django_auto_actions-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

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

Hashes for django_auto_actions-0.1.0.tar.gz
Algorithm Hash digest
SHA256 37e289048a58fa093c002e903398d2ff9c21ff9c9fd932cbc97394781f3a59fb
MD5 97af12591fced1f3e740a7983e010d24
BLAKE2b-256 bbc572d27cccda5d67bb47d482358f4c53c58c4c1fbe557cb5b74ca1148b66c9

See more details on using hashes here.

File details

Details for the file django_auto_actions-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_auto_actions-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b507a404a731cfd9ba3909277a67a7ebf3ab2cae92fa51d3e0c36cc3f55cadab
MD5 31643974cbf8d2d0a7d336e283900562
BLAKE2b-256 4ecdb35d028c585a0bc85c1ab069641a28f8ff76e700f618de50ebb8c89bd1ba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page