django-taggit-serializer icon indicating copy to clipboard operation
django-taggit-serializer copied to clipboard

Not work with django-taggit==2.0.0

Open tamhv opened this issue 3 years ago • 2 comments

django-taggit==2.0.0
django-taggit-serializer==0.1.7
class Blabla(TaggitSerializer, serializers.ModelSerializer):
  tags = TagListSerializerField()
  ...
...site-packages/taggit_serializer/serializers.py", line 108, in _save_tags
getattr(tag_object, key).set(*tag_values)
TypeError: set() takes 2 positional arguments but 3 were given

All good with django-taggit==1.5.1

tamhv avatar Dec 08 '21 13:12 tamhv

Thanks for this, had the same problem and had been trying to work out what I was doing wrong for ages.

joekbullard avatar Dec 21 '21 20:12 joekbullard

This is due to the breaking change where set now takes a list instead of varargs.

A fix can be done by changing line 107 from serializers.py to getattr(tag_object, key).set(tag_values).

I have since opened a pr #55.

adriangzz avatar Dec 25 '21 18:12 adriangzz