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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 518bb8d8607feeb4b1eee351f950953065c43d5774e1ae1a1fbbd9b1c148e964 |
|
MD5 | e5860e8a06674a1ca4d2bcadadd2dc95 |
|
BLAKE2b-256 | 84c1c1f2d8449662f7a28c8a055094fafc65859a5d245f2232ef981dc1fa8595 |
Close
Hashes for django_admin_buttons-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a8443b67f1cbe0201729cdad1506ab18c11e79350962b9d772280b399d49b88 |
|
MD5 | aa5e6a86453ba1bc429c01cbcab4922b |
|
BLAKE2b-256 | c785f830752f31853be471c8738558e63b5cef41b5a6d2198def91fb844ae5e8 |