Questions tagged [django-taggit]

django-taggit is a reusable Django application designed to making adding tagging to your project easy and fun.

django-taggit works with Django 1.1 and 1.2 (see Known Issues for known issues with older versions of Django), and Python 2.4-2.X.

306 questions
3
votes
2 answers

Optimize django query to pull foreign key and django-taggit relationship

I have a todo model defined below: class Action(models.Model): name = models.CharField("Action Name", max_length=200, unique = True) complete = models.BooleanField(default=False, verbose_name="Complete?") reoccurance =…
Ed.
  • 4,439
  • 10
  • 60
  • 78
3
votes
4 answers

django-taggit create tagcloud from queryset

I could not find an answer for this.. So here my question. For a new project i'd like to use django-taggit. Does someone have a suggestion on how to create a tag-cloud based on the current queryset? The desired behavior is to 'start' with an…
ohrstrom
  • 2,890
  • 2
  • 20
  • 34
2
votes
2 answers

How to call a Django function from template and save return in a variable

Context: I have a piece of HTML that I want to dispaly in the template just in case a function return "true". Details: My function def show_avg_kpi(): return config.avg_times_visible register.filter('show_avg_kpi', show_avg_kpi) Template ( is…
S_Devol
  • 31
  • 6
2
votes
1 answer

Extending TagBase in Django-Taggit

I have created the following TagBase and each category can have subcategory... Will this work? How can I override its add function in the TaggableManager? class Category(TagBase): parent = models.ForeignKey('self', blank=True, null=True, …
Eyad Sibai
  • 811
  • 7
  • 21
2
votes
2 answers

Lowercase Field values django models queryset

I have a Model of an object and few tags are assigned to the object of this model. Tags may be uppercased, lowercased or mix of both cases. I want to write a queryset which will return those object which has same tags which I provided. Note: I am…
2
votes
1 answer

How to send value to filter in if condition django?

In my html, I want to send this values to my filter but I got this error : ValueError at / invalid literal for int() with base 10: '{{request.user.id}}' My HTML:
cksylr
  • 61
  • 5
2
votes
0 answers

update_view - tags field update gives other values (django-taggit)

I am trying to build a Blog and for my tag system I thought would be great to use django-taggit but there is a problem when I want to update the BlogPost This is how I add them when I create the Blog Post: tag1, tag2 ,tag3 And this is how it looks…
Dragos Neata
  • 153
  • 7
2
votes
0 answers

TaggableManager with blank=True raise IntegrityError when creating object in admin panel

I have a model and an admin defined: models.py from adminsortable.models import Sortable class Category(Sortable): site = models.ForeignKey('sites.Site', related_name='+', on_delete=models.CASCADE) name = models.CharField(_('Name'),…
Dibidalidomba
  • 757
  • 6
  • 17
2
votes
0 answers

Django-taggit: validate what a user inputs

django-taggit==1.2.0 Django==3.0.8 class TagMixin(models.Model): tags = TaggableManager(verbose_name="Tags") # django-taggit class Meta: abstract = True class Post(TagMixin, models.Model): category =…
Michael
  • 4,273
  • 3
  • 40
  • 69
2
votes
1 answer

django-taggit problem with Persian language

I am working with django and also I want to use django-taggit for tags but the problem is that for Persian language when I use django-taggit I cannot use Persian words because it has problems to use Persian words as slug. What can I do? Is there any…
SAM
  • 103
  • 4
  • 14
2
votes
1 answer

Django iterate queryset just n number of times in templates

My issue is quite simple. I am using Django taggit. I want to iterate this only 2 times. Means to display only 4 tags in templates. {% for tag in data.tags.all %} {{tag}} {% endfor %} I have tried this, but it is…
Maha Waqar
  • 585
  • 1
  • 10
  • 24
2
votes
1 answer

How to display django tags in update form (django-taggit)?

I made a basic blog post app in django and I'm using the django-taggit project (https://github.com/jazzband/django-taggit) to create taggable Model objects. However, tags show up as a query set in my update form field: Here is…
winston
  • 3,000
  • 11
  • 44
  • 75
2
votes
2 answers

Django-taggit tag value retrieval and formatting failing

I am trying to implement a tagging process for profiles so you can add your hobbies for example. I have chosen django-taggit as it seemed quite simple and does what I need it to, plus don't really know how to do it myself from scratch. I have…
Limeran
  • 173
  • 1
  • 3
  • 13
2
votes
1 answer

Why Taggit (Django-Tag) won't work once I used Tag.models.all()

I have implemented django-taggit successfully until I was trying to use the mixin to render the tags on a ListView of "PropertyListing" in this example: The console keep telling me: NameError: name 'Tag' is not defined **The PROBLEM comes from the…
Curtis Banks
  • 342
  • 4
  • 20
2
votes
3 answers

django/taggit - error: MyData objects need to have a primary key value before you can access their tags

I'm trying to use django-taggit (see). This is what I have in my code: models.py class MyData(models.Model): title = models.CharField(blank=True, max_length=50) ..... tags = TaggableManager() views.py g = MyData(title=f_title) …
avatar
  • 12,087
  • 17
  • 66
  • 82