#8063 closed (fixed)
Taking a slice of a queryset does not respect extra(...)
Reported by: | zbyte64 | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | queryset | |
Cc: | zbyte64@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
If you do a qs as the following:
>>> foo = MyObjects.objects.all().extra(select={'relevance': match_expr}, where=[match_expr], params=[query]) >>> print foo >>> bar = MyObjects.objects.all().extra(select={'relevance': match_expr}, where=[match_expr], params=[query]) >>> print bar[:10]
The first 10 elements of foo may not match bar, bar will simply be the first 10 objects and it discards the extra where clause.
Change History (7)
comment:1 by , 16 years ago
Component: | Uncategorized → Database wrapper |
---|
comment:2 by , 16 years ago
milestone: | → 1.0 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 16 years ago
Description: | modified (diff) |
---|
comment:4 by , 16 years ago
Summary: | Taking a slice of a queryset with extras specified alters the query → Taking a slice of a queryset does not respect extra(...) |
---|
comment:5 by , 16 years ago
comment:6 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I cannot duplicate this in any fashion. In [8427], I've added a test in case to make sure this doesn't become an issue again, but it seems to have been fixed by something in the interim.
If anybody thinks it still exists, please create a modification of the above test to show the problem so that we have some repeatable to debug (the original report in this ticket doesn't details on a concrete test, since information about match_expr
and so forth are missing).
Changing the description, because I keep seeing it in summaries and thinking "of course it does. Otherwise there would be no point!", which isn't really what the problem is about.