Re: Django builds wrong sql query.

2015-03-19 Thread Алексей Широков
Thanks for your reply, I will try... -- 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+unsubscr...@googlegroups.com. To post to this group, send email

Re: Django builds wrong sql query.

2015-03-19 Thread Tim Graham
Try ditching .extra() and using the expressions API in Django 1.8. We're trying to make everything that's possible with .extra() available through better APIs so try to avoid it as even if there is a bug, it's probably unlikely to be fixed. On Thursday, March 19, 2015 at 9:11:39 AM UTC-4, Алекс

Django builds wrong sql query.

2015-03-19 Thread Алексей Широков
*I have the following code:* package_queryset = Package.objects.extra( where=[(' "document_package"."id" IN (SELECT DISTINCT ON ("document_id") "id"' ' FROM "document_package"' ' WHERE "status" NOT IN (\'unknown\