Skip to content

This app provides a tag-filter and an admin-action to handle tags created with `taggit` within the django admin backend.

License

Notifications You must be signed in to change notification settings

thomst/django-admin-taggit-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to django-admin-taggit-ui

python: 3.8, 3.9, 3.10,3.11 django: 3.0, 3.1, 3.2, 4.0, 4.1, 4.2, 5.0, 5.1 Run tests for django-admin-taggit-ui Coveralls

Description

This app is build in top of django-taggit and provides a tag-filter and an admin-action to handle tags with ease within django's admin backend.

Tag-Filter

The tag filter allows you to include and exclude mutliple tags as well as easily deleting tags.

Admin-Action

The admin action allows you to easily add and remove tags from objects.

Installation

Install from pypi.org:

pip install django-admin-taggit-ui

Setup

Add more_admin_filters to your installed apps:

INSTALLED_APPS = [
    'taggit_ui',
    ...
]

Extend your url_patterns in urls.py:

urlpatterns = [
    ...
    url(r'^', include('taggit_ui.urls')),
]

Add the TagFilter and manage_tag action to your ModelAdmin:

from taggit_ui.filters import TagFilter
from taggit_ui.actions import tag_manager

class MyModelAdmin(admin.ModelAdmin):
    ...
    list_filter = [
        TagFilter,
        ...
    ]
    actions = [
        tag_manager,
        ...
    ]

It is possible to optionally tag related items of other models using the admin action. Therefore initialize the TagManager` class with a ModelTree:

from taggit_ui.actions import TagManager
from modeltree import ModelTree

class MyModelAdmin(admin.ModelAdmin):
    ...
    actions = [
        TagManager(ModelTree),
        ...
    ]

The admin action will then render its form with all taggible related Models as checkbox fields and the count of related items belonging to these models.

About

This app provides a tag-filter and an admin-action to handle tags created with `taggit` within the django admin backend.

Resources

License

Stars

Watchers

Forks

Packages

No packages published