#33772: Queryset first() returns different result than queryset[0] when using ExpressionWrapper -------------------------------------+------------------------------------- Reporter: Pablo Pissi | Owner: nobody Type: | Status: new Cleanup/optimization | Component: Database layer | Version: 3.2 (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted ExpressionWrapper,first,queryset | Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Carlton Gibson):
* status: closed => new * type: Uncategorized => Cleanup/optimization * resolution: needsinfo => * stage: Unreviewed => Accepted Comment: Thanks both. Good. > Thoughts on the value of such adjustment Carlton? We do see tickets periodically running into this problem: I recall a number of occasions seeing links to that same docs section. I guess for every one that we see there are several/many in the wild we don't The `first()` docs link to the ''Interaction with order_by()'' section there, presumably to try to forestall this confusion, but I still get the impression it's one of the more subtle points of the ORM behaviour, so if we can provide a better error message to point folks in the right direction that's likely a win. 🤔 I'll provisionally accept on that basis. (Mariusz can object on review if he doesn't like it 😃) Pablo would you like to work on a PR based on Simon's suggestion? -- Ticket URL: <https://code.djangoproject.com/ticket/33772#comment:6> Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/010701814741d430-53c6780a-4414-48b4-8225-0bedc225b5ca-000000%40eu-central-1.amazonses.com.