Как я могу получить всплывающие данные в django
пожалуйста, как я могу получить атрибут id_benevole класса Participer(Models) мне нужно показать его во всплывающем окне Я использую этот метод, но ничего не отображается
Заранее спасибо
Это -------->Models.py
class Participer(models.Model):
id_benevole = models.CharField(max_length=150,null=False,blank=False)
id_mission = models.CharField(max_length=150,null=False,blank=False)
# def __str__(self):
def __str__(self):
return self.id_mission
Это ------->Views.py
def getLB(request):
participer=Participer.objects.all()
context={
'participer':participer
}
print(participerss)
return render(request, 'home/Association.html',context)
Это ----------> Association.html
{% for miss in missions %}
<th scope="row">{{miss.id}}</th>
<td>{{miss.nom}}</td>
<td>{{miss.domaine}}</td>
<td>{{miss.lieu}}</td>
<td style="white-space: nowrap;width: 1%;" >{{miss.date_publier}}</td>
<td style="text-align: center;">{{miss.nombre_participant}}</td>
<td>{{miss.association.association.nom_association}}</td>
<td><a type="button" class="btn btn-danger mt-5" data-bs-toggle="modal" data-bs-target="#myModal" class="col-11 text-center mt-3">Voir liste des bénévoles</a></td>
<div class="modal mt-5" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="d-flex justify-content-center text-danger">
<h4>Liste des bénévoles participants</h4>
</div>
{% for par in participer %}
<div class="modal-header">
{{par.id_mission}}
{{par.id_benevole}}
</div>
{% endfor %}
<div class="modal-footer">
<div class="col-11 text-center mt-3">
<input class="btn gradient-bg" type="submit" value="Confirmer"/>
<input type="button" class="btn gradient-bg" data-bs-dismiss="modal" value="Annuler"/>
</div>
<div>
</div>
</div>
</div>
{% endfor %}