- def save(self):
- assert self.instance, 'No instance provided'
- self.instance.tags.remove(*self.instance.tags.filter(category=self.category))
- self.instance.tags.add(self.cleaned_tags())
+ def save(self, instance=None):
+ instance = instance or self.instance
+ assert instance, 'No instance provided'
+ self.category.set_tags_for(instance, self.cleaned_tags())