I'm using Python with the Django framework. This method should return a resulting query, to send e-mail to the corresponding e-mails from the database. However, the method works for some cases and for others it does not.
from django.db.models import Q
def membrosBancaAtual(semestre):
semestre = semestre.filter(atual = True)
disciplina = Disciplina.objects.filter(semestre = semestre)
projetos = ProjetoDeGraduacao.objects.filter(disciplina__in = disciplina)
query = Q(banca2__in = projetos)
return query
Does anyone have a clue why some things work and others do not?