New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

django-changelist-toolbar-admin

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-changelist-toolbar-admin

Provides custom button management function on changelist page of django admin site.

  • 0.4.5
  • PyPI
  • Socket score

Maintainers
1

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_button get return the final buttons.

Releases

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_buttons to django_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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc