Using python and django, problem with querys

0

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?

    
asked by anonymous 14.10.2015 / 21:35

1 answer

0

Your query should be used in a query:

Model.objects.filter(banca2__in=projetos)

. This return query throws the query to where?

    
18.10.2015 / 23:27