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

Better way to delete unused tag. / django taggit python

Hi i'm python django beginner. I'm creating a simple blog and i want to delete tags that are not used while deleting a post class Post(models.Model): title = models.CharField(max_length=50) content = models.TextField(max_length=500) …
wowsber
  • 57
  • 3
3
votes
1 answer

How to add multiple tags to URL in Django and Taggit

I have this model here, where I pass the tags using TaggableManager. class Post(models.Model): title = models.CharField(max_length=120) content = models.TextField() date_published = models.DateField(auto_now_add=True) tags =…
3
votes
1 answer

How to use django-taggit similar_objects() with Class-based views

I want to display 4 related item on my template which have the same tags as the current item. I'm using the greate package django-taggit and I have read django-taggit doc and they didn't explain how to use "similar_objects() " to make related item…
DAMAR225
  • 1,993
  • 1
  • 13
  • 22
3
votes
2 answers

How can I use taggit-selectize so that all user-made tags show up in the autocomplete?

I found this project https://github.com/chhantyal/taggit-selectize and it seems to do what I want, but the example app is incomplete, so I don't know how to use it. What I basically want is that users will be able to write their own tags for a post,…
user8954282
3
votes
1 answer

How to filter django-taggit top tags

Suppose you have a database with User objects running behind a Djano app and you want to use django-taggit to tag User objects so you can retrieve subgroups using some convenient filtering. Additionally you have a Dashboard where you want to display…
MSB
  • 854
  • 7
  • 24
3
votes
1 answer

django-taggit: how to programmatically create tags?

For example: tags_input = "hello, foo, bar, ok" tagset = tag_parser(tags_input) # {'bar', 'foo', 'hello', 'ok'} obj = Post(title=title, tags=tagset) obj.save() The above snippet doesn't seem to work. How can I create tags programmatically? e.g. in…
Zilong Li
  • 889
  • 10
  • 23
3
votes
4 answers

Indexing Taggit tags with Algolia for Django: '_TaggableManager' object has no attribute 'name'

I'm having some issues using the Algolia Django integration with one of my models which contains a TaggitManager() field. I'm currently being thrown back the following error when running this command: $ python manage.py…
user7179686
3
votes
1 answer

Search django-taggit tags

I need help adding in the django-taggit tags to my search function. I'm currently using the search function that I found on here (Search page on the django). Is there any way to incorporate taggit into this? Or am I better off using a package…
pheeper
  • 1,457
  • 4
  • 20
  • 37
3
votes
1 answer

Django __in lowercase

I'm using django-taggit, which handles the attachment of tags to arbitrary content types. I imported a large tag list, which contains many uppercase words, as well as lowercase words. Now, I' trying to get objects of another class containing a set…
schneck
  • 10,556
  • 11
  • 49
  • 74
3
votes
1 answer

Add a custom user-facing form to Django app (uses selectize and taggit)

I'm fairly new to django, and I'm trying to figure out how to create a form using the taggit-selectize widget (or django-taggit). Everything I've found online refers to its use the admin page, but I want the tags to be user-facing and editable -…
Soul Donut
  • 357
  • 3
  • 12
3
votes
1 answer

How do I import tags using django-import-export?

I want to import certain fields as django-taggit tags, using django-import-export. How do I do this?
seddonym
  • 16,304
  • 6
  • 66
  • 71
3
votes
1 answer

Django-taggit adding new tags to an object?

My models.py class X(models.Model): ... tags = TaggableManager() How to add tags to an object. If I do: x = X.objects.get(pk = 123) x.tags.add( "sample_tag" ) It adds the tag twice, if the tag with same name (i.e "sample_tag" in the above in the…
Coderaemon
  • 3,619
  • 6
  • 27
  • 50
3
votes
2 answers

How to create a Factory-Boy factory for a model with TaggableManager field

How can I create a field in Factory-Boy to TaggableManager from django-taggit? The following does not work: First: class ExperimentFactory(factory.DjangoModelFactory): class Meta: model = Experiment django_get_or_create =…
user3142459
  • 630
  • 5
  • 18
3
votes
1 answer

Django taggit, using a custom tagname

I've set up django-taggit and it's working fine, all tags are listed under tags in admin. However, I now want to separate my tags into 2 groups, english tags, and spanish tags. This is what I have, from the documentation here: class…
rix
  • 10,104
  • 14
  • 65
  • 92
3
votes
2 answers

django-taggit-autocomplete and south

I use django-taggit-autocomplete, but when doing a schememigrating, I got an error ! Cannot freeze field 'main.hotels.tags' ! (this field has class taggit_autocomplete_modified.managers.TaggableManagerAutocomplete) ! Cannot freeze field…
Douglish
  • 293
  • 3
  • 15