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

How to add tag urls to sitemap.xml?

I'm working on sitemap.xml generation for Django + Wagtail project. I implemented xml generation for articles by overriding get_sitemap_urls method. But the problem is that Wagtail sitemap generator doesn't "see" the blog tags urls (doesn't add…
arturkuchynski
  • 790
  • 1
  • 9
  • 27
2
votes
3 answers

Using Django-taggit and django-taggit-serializer with issue

I am trying to add tags in my model by taggit and taggit serializer. I making my API in rest framework. I followed the instruction(https://github.com/glemmaPaul/django-taggit-serializer) but it is still an issues: "tags": [ "Invalid json…
hsbzzhz
  • 79
  • 10
2
votes
2 answers

How can I add an extra field to a proxied model in Django?

I'm specifically talking about the Tag model, which I have no much experience with. The code goes like this: @register_snippet class ArticleTag(index.Indexed,Tag): class Meta: proxy=True search_fields = [ index.SearchField('name',…
Pablo Viacheslav
  • 873
  • 1
  • 8
  • 15
2
votes
1 answer

Django/Wagtail/taggit - Getting model specific tag list

I have seen this: Generating a unique list of Django-Taggit Tags in Wagtail; and the solutions there have generated a list of all stored tags, i.e. image, document, etc tags. I am trying to accomplish a similar goal. On a News Index Page, have a…
JVsquad
  • 57
  • 1
  • 8
2
votes
2 answers

Getting related objects via tags in Django

My goal is to build a "Recommended Products" section in my e-commerce website when accessing an individual product page. I have a sereis of products which have several user-defined tags in the admin. The tagging system is a combination of…
DDiran
  • 533
  • 1
  • 6
  • 23
2
votes
1 answer

Django-taggit. Multi-tags in a model. Retrieve data

Here is a model with multiple tags in it. How do I retrieve data from tags_en? tags.names() works well but not tags_en.names() nor tags_en.all() from taggit.models import GenericUUIDTaggedItemBase, TaggedItemBase, TagBase from…
Phill M
  • 21
  • 2
2
votes
1 answer

Django Taggit - AttributeError: can't set attribute

yesterday I installed PostgreSQL as db for the website That I'm developing. After the installation the computer restarted. What's wrong? I lost all the environment variables (i'm using windows 10). So I had to re add python to the path. After That I…
scotch
  • 171
  • 3
  • 14
2
votes
2 answers

Filter by multiple django-taggit tags with Django Rest Framework

Default SearchFilter only allows us to filter (tags in my case) if all the provided terms are matched. class MyModelViewSet(viewsets.ReadOnlyModelViewSet): filter_backends = (filters.SearchFilter, ) search_fields = ('tags__name',) …
primoz
  • 885
  • 3
  • 12
  • 32
2
votes
0 answers

How do I go about creating a TagBlock that I can use in a StructBlock and not in a page

Something like this where the field emails is a django-taggit field which queries the email model and suggests emails. class MailingList(blocks.StructBlock): """ A collection of emails """ name = blocks.CharBlock(max_length=255) …
Mevin Babu
  • 2,405
  • 21
  • 34
2
votes
1 answer

django-filters BaseInFilter with CharFilter returns no results when empty with django-rest-framework

I'm using django-taggit for tags, so it's essentially just a m2m relationship. The following lets me filter tags with a comma-separated string. However, the browsable API with django-rest-framework submits empty filter parameters, and &tags= with no…
2
votes
3 answers

django taggit similar_objects very slow query

I am trying to select the 3 most recently published items, with any tags similar to the current item (and some other filters too) Can't find an efficient way to do it, there are a lot of 'item' in the DB. from taggit_autosuggest.managers import…
straykiwi
  • 538
  • 6
  • 23
2
votes
2 answers

Django taggit - retrieving tags into a template

I've set up django-taggit and it's working fine, all tags are listed under tags in admin and I can add tags through the admin and in a form. I'm having real trouble listing the tags in a template (basically I want a long list of all objects with…
2
votes
1 answer

How to access the custom through model in django-taggit

how to add extra information to the tag system or access through model in django-taggit? My model 'Post' has an image and a TaggableManager, so that each Post (or image) can have multiple tags on it, and users can search all posts by their tags. …
John Pang
  • 2,403
  • 25
  • 25
2
votes
1 answer

Restrict certain users from adding new tags , django-taggit?

i'm quite new to django framework, i'm creating a blog application from scratch , and i am integrating django-taggit, to tag the articles. What im trying to accomplish is that , i want only certain users to be able to add new tags and the rest of…
thecreator232
  • 2,145
  • 1
  • 36
  • 51
2
votes
2 answers

Return a list of objects from selected tags

I am trying to figure out what I thought would be easy to find an answer for. I am using django-taggit in a project and I simply want to return a list of objects when a tag is selected. I have tried this: How do I create list and detail views for…
phyichai
  • 45
  • 7