[Answered ]-Django views.py, I want to render all the attributes of a ManyToManyField from my object

2👍

Generally, unless you have a very good need for optimisation, you should always pass the full model objects to the template.

My rule of thumb is always to start from the model you want: since you want regions, start from the model that defines them (strangely called Country). You’re after all the regions that are associated with an article, so just query for that:

 region_for_articles = Country.objects.exclude(regions_press_article=None)

Leave a comment