class Curso(models.Model):
fecha = models.DateField()
hora_inicio = models.TimeField()
hora_fin = models.TimeField()
capacidad_maxima = models.PositiveSmallIntegerField(default=6)
sede = models.ForeignKey(Sede)
profesor = models.ForeignKey(Profesor)
estudiantes = models.ManyToManyField(Estudiante,blank=True)
tipo_nivel = models.CharField(max_length='2',default='xx')
tipo_leccion = models.PositiveSmallIntegerField(default=0)
max_tipo = models.PositiveSmallIntegerField(default=3)
tipo_estudiante=models.ManyToManyField(Nivel,related_name='tipo_estudiante', blank=True)
I have this model, I need to make a Query that returns only the courses that are empty or at the student's level, additional if there are more courses at the same time and they are empty, just give me the various courses or the course of the student's level for that hour.