djangosnippets.org: Latest snippets tagged with 'taggit'https://djangosnippets.org/tags/taggit/2012-08-31T14:24:44.364995-05:00Filter by taggit tags in the admin (Django 1.4)
2012-08-31T14:24:44.364995-05:00albertorcfhttps://djangosnippets.org/snippets/2807/<p>A <em>SimpleListFilter</em> derived class that can be used to filter by taggit tags in the admin.</p>
<p>To use, simply add this class to the <em>list_filter</em> attribute of your ModelAdmin class.</p>
<p>Ex.:</p>
<pre><code>class ItemAdmin(admin.ModelAdmin):
list_display = ('name', 'unit', 'amount')
list_filter = ('unit', TaggitListFilter)
</code></pre>
<p>Based in <a href="https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter">ModelAdmin.list_filter documentation</a>.</p>
Freely redistributableFilter by taggit tags in the admin
2011-10-12T11:22:44.706136-05:00flupkehttps://djangosnippets.org/snippets/2570/<p>A FilterSpec that can be used to filter by taggit tags in the admin.</p>
<p>To use, simply import this module (for example in <code>models.py</code>), and add the name of your TaggableManager field in the
list_filter attribute of your ModelAdmin class.</p>
Freely redistributable