Skip to main content

A Django App that highlights selected rows on the admin UI.

Project description

django-highlightselect-model-admin

Description

A Django App that highlights selected rows on the admin UI.

Usage

in settings.py

INSTALLED_APPS = [
...
'highlightselect_model_admin',
...
]

collect statics

python manage.py collectstatic

in admin.py

from highlightselect_model_admin import HighLightSelectModelAdmin
from .model import MyModel

@admin.register(MyModel)
class MyModelAdmin(HighLightSelectModelAdmin):
    """
    Inherit from HighLightSelectModelAdmin insead of django.contrib.admin.ModelAdmin
    """
    ...
    action = ('my_action', )
    
    def my_action(self, request, queryset):
        selected_ids = []
        for q in queryset:
            selected_ids.append(q.id)
        
         self.highlight_message_user(request, 'Selected!', selected_ids)

Issues

https://github.com/laonan/django-highlightselect-model-admin/issues

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

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page