TaggableManager.set() API does not match RelatedManager.set()
See original GitHub issueTaggableManager has set(*tags, clear=False)
while RelatedManager expects the tag objects as a list ie set(tags, bulk=True, clear=False, through_defaults=None)
.
Would it be possible to support setting tags as a list/tuple too? The different interface makes it harder to plug that TaggableManager into other django libraries.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
django-taggit
tags = TaggableManager(). Note: If you want django-taggit to be CASE-INSENSITIVE when looking up existing tags, you'll have to set.
Read more >Using Django-taggit with django-rest-framework, i'm not ...
meet the same question. But I just want to save the tag list directly by TaggableManager (without TagListSerializer and TagsListAPIView).
Read more >Changelog — django-taggit 1.3.0 documentation
Backwards incompatible: TaggableManager.set now takes a list of tags (instead of varargs) so that its API matches Django's RelatedManager.set . Example:.
Read more >'_TaggableManager' object is not iterable-django
Exception Value: '_TaggableManager' object is not iterable ... with CONTROL-C. > /Users/gr/Desktop/PycharmProjects/godo/api/serializers.py(112)create() ...
Read more >prefetch_related - new feature suggestion
There is also a fairly nasty use of .extra() which is needed so that ... that did require changing your code (no API...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I agree 100% that this is a bug. I’ve now been burned by this difference in APIs between
TaggableManager.set()
andRelatedManager.set()
, as I’m trying to use the same code to set various different types of tags on objects, and only one of those types is handled by django-taggit. So the API being different screws me.I’ve been facing this issue trying to use a “tags” field together with the library “django-import-export”. It’s been impossible.