Login

Snippets by albertorcf

Snippet List

Filter by taggit tags in the admin (Django 1.4)

A *SimpleListFilter* derived class that can be used to filter by taggit tags in the admin. To use, simply add this class to the *list_filter* attribute of your ModelAdmin class. Ex.: class ItemAdmin(admin.ModelAdmin): list_display = ('name', 'unit', 'amount') list_filter = ('unit', TaggitListFilter) Based in [ModelAdmin.list_filter documentation](https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter).

  • filter
  • tag
  • admin
  • tags
  • tagging
  • taggit
Read More

albertorcf has posted 2 snippets.