Created
July 5, 2018 22:35
-
-
Save fhdez/242f9876c429ad90b92e55894e958d55 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#usuarios - alumnos a los que se les mando el mensaje | |
hijos = ReceiverMessage.objects.filter(message_id=52).values_list('user__email', flat=True) | |
#extraer el padre por el email de los hijos, salio none | |
for u in User.objects.filter(email__in=hijos): | |
print u.parent, u.children | |
#la forma para traer a los hijos - email, que se mando fue con: | |
for u in User.objects.filter(children__email__in=hijos): | |
print u.email, u.children.all().values_list('email', flat=True) | |
for r in ReceiverMessage.objects.filter(user__email='[email protected]'): | |
print r.message_id, r.was_read, r.user.children.all().values_list('email', flat=True) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment