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
2
votes
1 answer

Filter tags in relationship with other model in taggit

I have 2 models: reviews and product: class Review(models.Model): user = models.ForeignKey(User, related_name="user_blog") tag = TaggableManager() product = models.ForeignKey(Product) review_text = models.TextField() created =…
Filipe Ferminiano
  • 8,373
  • 25
  • 104
  • 174
2
votes
1 answer

django-taggit custom 'tag' model and request.user

I have a requirement to track when and by whom a tag was created and so have created a custom tag model using django-taggit like so class Topics(TagBase): featured = models.BooleanField(_('Featured'), default=False) created =…
2
votes
1 answer

can't make autocomplete_light filter taggit tags based on request user

I apologize if this has nothing to do with both apps. The following snippet will throw me a "cannot filter a query once a slice has been taken": models.py class Cartao(models.Model): ... user = models.ForeignKey(settings.AUTH_USER_MODEL) …
user1182765
2
votes
1 answer

Using Check boxes in Taggit

I am trying to use Taggit for users to be able to tag their posts while they are submitting a form. But I can successfully let them type manually(their tags), I am trying to change to check boxes. Any ideas? forms.py class…
2
votes
1 answer

Can you include a TaggableManager as a filterset for django-filter?

I'm using both django-taggit and django-filter in my web application, which stores legal decisions. My main view (below) inherits from the stock django-filter FilterView and allows people to filter the decisions by both statutes and parts of…
cms_mgr
  • 1,977
  • 2
  • 17
  • 31
2
votes
1 answer

how to change the verbose_name or use original field name in django-taggit tag field

I am using django-taggit for one of my projects and as per the documentation I did the following in the model that i want to use tags / keywords in. models.py from taggit.managers import TaggableManager class SomeModel(models.Model): title =…
Amyth
  • 32,527
  • 26
  • 93
  • 135
2
votes
2 answers

How can I have django-taggit tags deleted when there are no more objects attached to them?

I think the title says it. Many tags are created and deleted but they still exist even when no more objects are using them. Is there a way to make it check upon save and delete unused tags?
azio
  • 575
  • 1
  • 6
  • 12
2
votes
1 answer

django-tastypie with django-taggit

I am using django-taggit for tagging. I have django-tastypie REST resource for the same object. While exposing the REST resource, it doesn't fetch the tag field(e.g. equivalent to model.tags.all()). Is there anything special needs to be done? I…
Mutant
  • 3,663
  • 4
  • 33
  • 53
2
votes
1 answer

Why is my django-taggit through model / tastypie query crashing my app?

I am relatively new to Django and have really been struggling with an implementation of a custom django-taggit app through the tastypie REST API. I have researched this and keep running into the same issues. I appreciate any help and guidance you…
bevinlorenzo
  • 486
  • 7
  • 18
2
votes
1 answer

Django filter to include all tags for which a certain type of item exists

I'm using django-taggit. I am tagging action items and info items. I want to list all tags for which there is an info item. I originally wrote: Tag.objects.filter(info_item__name__isnull=False).annotate(info_item_count=Count('info_item')) But…
Ed.
  • 4,439
  • 10
  • 60
  • 78
1
vote
1 answer

Django-taggit: how to search for all tags based on another column or foreign key?

The django-taggit example shows how to get all tags for one specific model, and I know there is a way to get all tags in the system, but how do I get all tags based on a foreign-key? I have tags for the Event model, and there is a…
user1192699
  • 103
  • 1
  • 3
1
vote
1 answer

Django-taggit: can not have all the data with key in tags object

I am trying to achieve my event model with tags object nested with it. But tags have only name field, I need both id, name and slug as well. here is my Model looks like model.py class Event(models.Model): title = models.CharField(max_length=151,…
1
vote
1 answer

Why Error when running code for show similar post with taggit in django 3?

I'm currently learning django by following the book Django by example from antonio mele and have reached the stage of how to display the same post using tags. I feel that I have followed the contents of the book well, but still stuck here Error in…
nsrrendra
  • 11
  • 1
1
vote
1 answer

Problem with tags in Django | used taggit for storing tags

Template file:
{% for event in events %} {% for tag in event.tags.all %} {% if tag == 'Tech' %}
1
vote
0 answers

Django taggit returns empty list of tags in search view

Explanation I would like to add to SearchView a filter that checks tags in my models and if raw_query contains tag then it displays the list of relevant objects. Each model contains title and tags fields. I am using django taggit with autosugest…
Adrian
  • 725
  • 4
  • 18