4
I would like to know how to make a template call to a field Many to Many of the models.
Follows code:
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 %}