#14110: iexact lookup doesn't work with subquery values ------------------------------------------+--------------------------------- Reporter: Suor | Owner: Suor Status: new | Milestone: Component: Database layer (models, ORM) | Version: 1.2 Keywords: | Stage: Unreviewed Has_patch: 1 | ------------------------------------------+--------------------------------- With PostgreSQL and model {{{ class Category(models.Model): title = models.CharField(max_length=127)
}}} we have: {{{ >>> Category.objects.filter(title__icontains=Category.objects.filter(pk=1).values('title')) DatabaseError: syntax error at or near "(" LINE 1: ...PPER("board_category"."title"::text) LIKE UPPER() (SELECT U0... >>> print connection.queries[-1]['sql'] SELECT "app_category"."id", "app_category"."title" FROM "app_category" WHERE UPPER("app_category"."title"::text) LIKE UPPER() (SELECT U0."title" FROM "app_category" U0 WHERE U0."id" = 1 ) }}} problem with every lookup for which %s is in the middle of connection.operators[lookup] -- Ticket URL: <http://code.djangoproject.com/ticket/14110> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.