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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc190facb40e68b9dc2aec7bd74405db9e8f5c1809d83ddc4731dbe81ce585c6 |
|
MD5 | e3d54ddae4ee501d6701ff4959e5c11b |
|
BLAKE2b-256 | a6cddc31414e0677c40ae9c876a8b6435b6de0356a1db47bd84a479cfb473423 |
Close
Hashes for django_admin_buttons-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d18c3dc866ad522de1c9541d89d73a9ff5dc6f9be69a485b81ce34a46c7d422 |
|
MD5 | f25d95d2e8cb5f83beccacb6885c7032 |
|
BLAKE2b-256 | 622b8d77be504b5a87a1a3a9898d34fa4e9ef24fde5d19318d53ca005860ed73 |