django-admin-buttons for the Django Admin.
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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3159b05d342d1eae98e3e70f93f32758a7785073bd023bcca3897557a1cac06b |
|
MD5 | 2595016d3fe5c9c0e45586685dfd9747 |
|
BLAKE2b-256 | 5c3e331740a1b845b19f68d6de6600dfc95418de5012b722923aac8f7f15cfb7 |
Close
Hashes for django_admin_buttons-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f68193422e7fef6e683646794443ef780f51ed78daeb2ef835c6c742f5a23cf9 |
|
MD5 | 92cd968de772513e9bda03aa174aacd5 |
|
BLAKE2b-256 | 550861b59e7b544c3235bd6d96154933c5230f06e1aee6757c50ba2e83182954 |