Opened 16 years ago

Last modified 13 years ago

#8063 closed

Taking a slice of a queryset with extras specified alters the query — at Initial Version

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

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 (0)

Note: See TracTickets for help on using tickets.
Back to Top