Django admin button
Project description
This package used to add a button functionality to the change list columns in the django admin, it uses the action methods used in the ModelAdmin
I wrote this package as an implementation for this article, it not hard to write the button yourself
Getting Started
Install the app
pip install django-admin-buttons
Add the app to the INSTALLED_APPS above the admin and static apps
INSTALLED_APPS = [
'django_admin_buttons', # add here
'django.contrib.admin',
'django.contrib.staticfiles',
Use the button as needed
from django.contrib import admin
from django_admin_buttons.admin_button import AdminActionButton
def Test_function(modeladmin, request, queryset):
# write you implementation here
pass
class AdminTest(admin.ModelAdmin):
# add the button
list_display = ('id', 'name', 'button')
# register the function
actions = [Test_function]
# create the function that displays the button
@admin.display()
def button(self, obj):
return AdminActionButton(obj.id, 'this', disabled = False, Class='btn-primary', label=None).render()
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
Built Distribution
Close
Hashes for django_admin_buttons-0.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23c6c304e8b46a6dd6af7098e4f7d0f5ed166110d5e40847a2c6a10fbe732939 |
|
MD5 | e61d73facbb8ed1ee3e4207ad2f6803a |
|
BLAKE2b-256 | bd5b3796195dd459ea97798e0fa0888302b445bbefbe1e21fca794bc41bfd72a |
Close
Hashes for django_admin_buttons-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 557ec60828142717fa29b181699c6570488f86e0d0bb0747e304cec992c48b97 |
|
MD5 | 31dcf66f1f15b85c176e2496e51e9b89 |
|
BLAKE2b-256 | 04346e3717f6a4444d30764e3318eacf29c9c38ef0b32311237f7630bf4e40f8 |