django-changelist-toolbar-admin
Provides custom button management function on changelist page of django admin site.
Install
pip install django-changelist-toolbar-admin
Usage
pro/settings.py
INSTALLED_APPS = [
...
'django_static_fontawesome',
'django_changelist_toolbar_admin',
...
]
- django_static_fontawesome is required, for already include the fontawesome css in Media's css settings.
app/admin.py
from django.contrib import admin
from django_changelist_toolbar_admin.admin import DjangoChangelistToolbarAdmin
from .models import Category
class CategoryAdmin(DjangoChangelistToolbarAdmin, admin.ModelAdmin):
list_display = ["name"]
search_fields = ["name"]
django_changelist_toolbar_buttons = [
"export_button",
"say_hi_button",
]
def export_button(self, request):
return "/export"
export_button.title = "Export"
export_button.icon = "fas fa-file-export"
export_button.target = "_blank"
def say_hi_button(self, request):
return {
"href": "javascript:alert('hi');",
"title": "Say Hi",
"icon": "fas fa-music",
}
admin.site.register(Category, CategoryAdmin)
- A button function must returns a Button instance, dict button info, or href.
- Another way is override
make_changelist_toolbar_buttonget return the final buttons.
Releases
v0.4.7
- Doc update.
v0.4.6
- Add data attr for toolbar button.
v0.4.5
- Add button classes support.
v0.4.3
- Doc update.
- Add django-app-requires support.
v0.4.0
- Fix document.
- Rename configuration item
changelist_toolbar_buttonstodjango_changelist_toolbar_buttons.
v0.3.0
- The main class rename to DjangoChangelistToolbarAdmin. Mixin is a very simple abstract class that provides helper functions, but DjangoChangelistToolbarAdmin is complex base admin, so we remove the mixin suffix.
v0.2.0
- App rename to django_changelist_toolbar_admin.
v0.1.0
- First release.
Metadata
Release files for django-changelist-toolbar-admin 0.4.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_changelist_toolbar_admin-0.4.7.tar.gz | 6.5 kB | Without provenance | Details for django_changelist_toolbar_admin-0.4.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_changelist_toolbar_admin-0.4.7-py3-none-any.whl | Python 3 | none | any | Details for django_changelist_toolbar_admin-0.4.7-py3-none-any.whl |
Total release size: 13.4 kB
Release files / django_changelist_toolbar_admin-0.4.7.tar.gz
| Download URL | django_changelist_toolbar_admin-0.4.7.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
907c465bdba6c19e774e7647535e5f021215ed4c2ac20cd10e153932bfdbcf58
|
|
BLAKE2b-256 checksum How to use checksums |
7dee084af6cc7a4ee3b40fbc7e928137f2763e5e544b1409199546f803aa97f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / django_changelist_toolbar_admin-0.4.7-py3-none-any.whl
| Download URL | django_changelist_toolbar_admin-0.4.7-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72298ff624785ea798b01948a7793bc5a137d3efcdfd2abb4bb0059429414a41
|
|
BLAKE2b-256 checksum How to use checksums |
404d7e4cf001fbe29ffea1e6418363f25a753602d02967a3f6d1c980143675f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Security for django-changelist-toolbar-admin 0.4.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.