Good afternoon I use Django 2.0 in an application to control attendees to an event, the idea is to generate a report of attendees, using the Assistance model, regardless of having more than one record, and the result of the query thrown me people without repeating them.
models.py
class Persona(models.Model):
nombres = models.CharField(max_length=50)
apellidos = models.CharField(max_length=50)
numeroDocumento = models.BigIntegerField()
telefono = models.CharField(max_length=15,null=True)
email = models.EmailField()
class Asistencia(models.Model):
persona = models.ForeignKey(Persona, on_delete=models.CASCADE)
hora = models.TimeField(default=time.strftime("%H:%M:%S"),editable=False)
fecha = models.DateField(default=date.today,editable=False)
views.py
personas = Asistencia.objects.filter(fecha__range=[fi,ff])
I've tried distinct but I do not get the expected result