Login

Tag "tagging"

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

getting the related entries with a templatetag using django-tagging

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
Read More
Author: V
  • 0
  • 2

Tagging System

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
Read More

Clouds Tag

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
Read More

Cloud Tag template example

This is the example of a Django Template that makes use of the clouds example given in the link. It uses the simple CSS selector font-style which can be expressed as per centage. Check the code in http://www.djangosnippets.org/snippets/473/

  • tag
  • template-tag
  • tagging
  • clouds
  • cloud
Read More

Clouds Tag

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
Read More

Case-insensitive lookup by default

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
Read More

django-tagging clouds template tag

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
Read More
Author: skam
  • 13
  • 59

9 snippets posted so far.