I would like to know how to make a call in the template to a many to many field of models.
Follow the code below:
Models
class Projeto(models.Model):
professor_participante = models.ManyToManyField(Servidor, verbose_name=u'Professores participante', blank=True)
Views
def projeto(request):
context={}
context['projeto'] = Projeto.objects.all()
return render(request, 'projeto.html', context)
template
{% for projetos in projeto %}
<li>Professor participante - {{ projetos.professor_participante }}</li>
{% endfor %}