Snippet List
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
Django tagging by default doesn't provide a templatetag to get the related objects for another object. Even though this is implemented as a model. Still, one can use the existing templatetags to achieve the same outcome.
Of course, writing a custom templatetag would be more efficient in terms of database access.
- templatetag
- tagging
- related
- django-tagging
This is my personal tagging system that I have created. It is intended to be used for multiple applications. This tagging system also has a build in tag cloud that will generate based on the most frequently used tags that you have used or based on the number of clicks users have clicked on a particular tag.
- tag
- django
- python
- tags
- tagging
- tagger
This is a simple template tag to create Tag Clouds. Based on the number of Posts (change the model_name according to your schema), Tags are provided different size ( most number of posts => most popular => and hence the largest.
We create a property called cloudsize for each tag, which is an integer between minsize and maxsize.
Check the example of sample template use here http://www.djangosnippets.org/snippets/472/
- tag
- template-tag
- tagging
- clouds
- cloud
This is a simple template tag to create Tag Clouds. Based on the number of Posts (change the model_name according to your schema), Tags are provided different size ( most number of posts => most popular => and hence the largest.
We create a property called cloudsize for each tag, which is an integer between minsize and maxsize.
- tag
- template-tag
- tagging
- clouds
- cloud
I wanted lookups on tags to be case insensitive by default, so that things like
Tag.objects.get(name='Tag')
would return any similar tags (ignoring case differences), i.e. `<Tag: tag>`.
This snippet makes lookup on the 'name' field case-insensitive by default, although
case-sensitive lookups can still be achieved with 'name__exact'. Methods like get_or_create
will work as expected and be case-insensitive.
- model
- tags
- tagging
- manager
- case-insensitive
- iexact
- queryset
template tag for producing tag clouds for a given model, using django-tagging application:
http://code.google.com/p/django-tagging/
Sample: http://skam.webfactional.com/tags/
Usage:
{% tags_cloud_for_model articles.Article as object_list %}
{% tags_cloud_for_model articles.Article as object_list step 6 %}
- template
- tag
- tags
- tagging
- templatetags
- clouds
9 snippets posted so far.