[Fixed]-Django queryset for many-to-many field

18👍

Try:

preference = Preference.objects.get(**conditions)
Article.objects.filter(categories__in = preference.categories.all())

2👍

Article.objects.filter(categories__in=myPreferenceObject.categories.all())

Leave a comment