1👍
✅
You can filter with:
Tag.objects.filter(cards_tags__card=obj, cards_tags__field='developer')
or you can work through the ManyToManyField
:
obj.tags.filter(cards_tags__field='developer')
Note: Models in Django are written in PascalCase, not snake_case,
so you might want to rename the model fromtoCards_Tags
CardTag
. In that case you filter withobj.tags.filter(cardtag__field='developer')
Source:stackexchange.com