Metadata-Version: 2.1
Name: django-highlightselect-model-admin
Version: 1.0.0
Summary: A Django App that highlights selected rows on the admin UI.
Home-page: https://github.com/laonan/django-highlightselect-model-admin
Author: Laonan
Author-email: hello@laonan.net
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/laonan/django-highlightselect-model-admin/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENCE

# 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


