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
1
vote
1 answer

Why does this Django filter query return empty list?

In my Vechicle table: Vechicle.objects.all().first().tags.slugs() when I test it in python manage.py shell >>> from django.db.models import Q >>> q_objects = Q(tags__slug='car') >>> q_objects &= Q(tags__slug='awd') >>>…
Ayeemba
  • 37
  • 4
1
vote
0 answers

Taggit django tags separated by a comma

I need to split string containing tags seperated by a comma to use in TaggIt, django. However when using split() : if request.method == 'POST': ... tags = request.POST.get('tags_hidden').split(',') my_object.tags.add(tag for tag in…
Wincij
  • 121
  • 10
1
vote
1 answer

Django-taggit: how to retrieve all tags filtered by a certain type of posts

I'm building a blog, and I have two status for a post, Published and a Draft. I wanto to display all tags of all published posts using Django-taggit. here's how a get all tags for all kind of posts, Published and Draft in my view: object_list =…
Diaku Zena
  • 11
  • 1
  • 4
1
vote
2 answers

In django-taggit tag is not save along with question post

when I created djanog question models all the fields are created but tag is not created with question model but separately tags are created in django admin taggit model.py class Question(models.Model): id = models.UUIDField(default=uuid.uuid4,…
Praveshji
  • 11
  • 3
1
vote
0 answers

django import tags error Line number: 1 - resource objects need to have a primary key value before you can access their tags

I am using django taggit in my models and trying to import data. But getting errors. Given below. Line number: 1 - resource objects need to have a primary key value before you can access their tags. models.py: class resource(models.Model): …
Malik Naveed
  • 49
  • 1
  • 3
1
vote
0 answers

django-taggit field not saving list Initially

I am using django-taggit for tags. I want to add all other fields of the same table in tags automatically when I save the data table. I am using the postsave method but all fields value are saved in the tags table but not in the Tags field of…
Malik Naveed
  • 49
  • 1
  • 3
1
vote
0 answers

Wagtail Tagging: How to keep chosen tag order?

I have a Page Model with Tags in it. class ProjectPage(AbstractContentPage): tags = ClusterTaggableManager(through=PageTag, blank=True) content_panels = AppPage.content_panels + [ FieldPanel('tags'), ... and in the template {% if…
1
vote
0 answers

UUID as primary key throws an overflow error despite trying to use taggit

I am trying to use UUID as a primary key on a model and it throws an Overflow error when using redirect. I looked online for similar problems as I assume it should be quite frequent that people want to do that. I came…
soso23
  • 83
  • 1
  • 8
1
vote
0 answers

django-taggit tag length increase problem

I use django-taggit in my django app. Is there a way to increase the tag length limit? I get errors that I passed my tag length limit. Thanks, Alex
alexarsh
  • 5,123
  • 12
  • 42
  • 51
1
vote
1 answer

Tags are not being stored in the database even after saving form in django

views.py def post(request): if request.method == 'POST': form = PostModelForm(request.POST) if form.is_valid(): post = form.save(commit=False) post.user = request.user post.save() …
1
vote
0 answers

Use django-taggit package with graphene mutations

I'm using the package django-taggit with graphene-django. Initially, I was getting the error specified in this question (Don't know how to convert the Django field skills (); but thanks to the answers there,…
1
vote
0 answers

Django-taggit: how to save after adding tags in save()

def save(self, *args, **kwargs): super(Flow, self).save(*args, **kwargs) if self.pk: self.tags.add(str(date.today().year)) self.save() This doesn't work in my model Flow. How can I save the newly added tag into tags of my…
xemexpress
  • 177
  • 1
  • 13
1
vote
1 answer

django templatetag, get posts related to current post's taggit-tags

I am writing a blog with django, and at the bottom of a blog entry i want to display the 5 latest entries relative to the tags i have attached using django-taggit. So i figured i needed to pass the current blog entry (the one we are viewing) to a…
mXed
  • 71
  • 8
1
vote
1 answer

how to show tags related to a particular tag in django taggit ?

I want to show a list of tags that is related to a particular tag(in an optimised way). I wonder why django-taggit does not provide an inbuilt functionality for this common task.
anand
  • 695
  • 9
  • 21
1
vote
0 answers

how to get tags from user in form and save it to database in django

I have a form that gets some fields and tags from users and save the user input data in database: By the way I am using taggit this is my model: from taggit.managers import TaggableManager class Question(models.Model): title =…
Yasaman Shokri
  • 145
  • 1
  • 1
  • 11