Opened 16 years ago

Last modified 13 years ago

#8063 closed

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

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 Malcolm Tredinnick)

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

comment:1 by Matt McClanahan, 16 years ago

Component: UncategorizedDatabase wrapper

comment:2 by adamfast, 16 years ago

milestone: 1.0
Triage Stage: UnreviewedAccepted

comment:3 by Malcolm Tredinnick, 16 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top