Problem with Queryset

14 views
Skip to first unread message

David Levy

unread,
Aug 7, 2015, 1:37:29 PM8/7/15
to Django users
Guys I have a strange problem the value that we report on my filter is passed to the queryset but the value is changed in queryset the query returning an unwanted result anyone ever go through this?


**** Filter Results ***
filtro = {'visualizado': False}

**** Call to Queryset *****
list_emails = retorno_publicacao_email.objects.using('default').filter(**filtro).all()

***** QUERY RESULT SET list_emails.query ******
SELECT "retorno_publicacao_email"."
id", "retorno_publicacao_email"."publicacao_id", "retorno_publicacao_email"."delivered_to", "retorno_publicacao_email"."message_id", "retorno_publicacao_email"."subject", "retorno_publicacao_email"."de", "retorno_publicacao_email"."to", "retorno_publicacao_email"."received", "retorno_publicacao_email"."cc", "retorno_publicacao_email"."content_transfer_encoding", "retorno_publicacao_email"."content_disposition", "retorno_publicacao_email"."x_attachment_id", "retorno_publicacao_email"."body", "retorno_publicacao_email"."bodyhtml", "retorno_publicacao_email"."anexo", "retorno_publicacao_email"."visualizado", "retorno_publicacao_email"."date" FROM "retorno_publicacao_email" WHERE "retorno_publicacao_email"."visualizado" = True

James Schneider

unread,
Aug 7, 2015, 8:57:48 PM8/7/15
to django...@googlegroups.com

Try removing the .all() at the end, you don't need it.

What does the QS look like before applying the filter (with just .all())? Are you using a custom model manager?

-James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4e1b2bc2-b309-4f4c-81fd-c4815b805f92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages