Raphael Gaschignard
Raphael Gaschignard
@thenewguy you can solve this by creating two different `TaggedItem` tables, but which both rely on the same `Tag` class ``` class ParentTagItem(TaggedItemBase): tag = ForeignKey(MyTagModel) class ImpliedTagItem(TaggedItemBase): tag =...
OK this topic definitely seems worthy of some FAQ-ing
@ChathuraGH This is a good point, we should have an FAQ for this, and some more explanations. Short version of this is you want to use [Custom Foreign Keys](https://django-taggit.readthedocs.io/en/latest/custom_tagging.html#custom-foreignkeys) here....
@int75 is this question about how to have a form that lets you choose what tag to have?
@heyitme sorry for the delay in replying here. I think this is mostly a consequence of the default tagging here being generic across models, and you can't query _through_ generic...
@lucemia here I guess you're suggesting that we just use a straightforward mapping of tag text to do a lookup? Seems pretty doable (with the usual caveats for custom tag...
@naveedur I'm not 100% sure here but your code might be having an issue because you call `super().save(*args, **kwargs)` after editing the tags (so the pk might get changed up)....
Does this code not work if you use the `post_save` hook instead of the `pre_save` hook? `pre_save` will likely run into issues with the instance changing, but `post_save` should probably...
Could you do something like: ``` print(instance.tags.all()) print(ans) instance.tags.add(*ans) print(instance.tags.all()) ``` and show the results here? that might make it a bit easier to debug what is going on
@chambersh1129 thanks for digging into this, I get what you're saying. I don't think this is really a bug, signals are really nastly like this. For me what I do...