GithubHelp home page GithubHelp logo

thomst / django-admin-taggit-ui Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 88 KB

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

License: BSD 3-Clause "New" or "Revised" License

Python 90.76% HTML 9.24%

django-admin-taggit-ui's Introduction

Welcome to django-admin-taggit-ui

python: 3.6, 3.7, 3.8, 3.9, 3.10 django: 2.2, 3.0, 3.1, 3.2, 4.0, 4.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.

django-admin-taggit-ui's People

Contributors

thomst avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ridaayed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.