[Answered ]-Django get queryset through Many To Many extra field

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 from Cards_Tags to CardTag. In that case you filter with obj.tags.filter(cardtag__field='developer')

Leave a comment