Opened 17 years ago
Closed 17 years ago
#6088 closed (fixed)
get_previous_in_order broken
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | qs-rf-fixed | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There's a bug in the SQL generated when calling get_previous_in_order. Luckily looks like a quick fix from where I'm sitting. Just need to change the ordering to DESC from ASC.
Attachments (1)
Change History (6)
by , 17 years ago
Attachment: | _get_next_or_previous_in_order.diff added |
---|
comment:1 by , 17 years ago
Has patch: | set |
---|
comment:2 by , 17 years ago
Keywords: | qs-rf added |
---|
I'll fix this on queryset-refactor, rather than trunk, but it looks basically correct.
comment:3 by , 17 years ago
Keywords: | qs-rf-fixed added; qs-rf removed |
---|
Through the magic of time machines, I fixed this back in [6486].
I'll note in passing, though, that the patch on this ticket isn't correct. The idiom
is_next and '' or '-'
is invalid when the second argument to the "and" portion evaluates to False. This expression will always return '-', regardless of the value of is_next
. The code in [6486] avoids this trap.
Ticket will be closed when queryset-refactor is merged into trunk.
comment:4 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Promoting to accepted: if it's fixed in the queryset refactor then it has obviously an accepted issue (even if the ticket isn't correct)
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [7477]) Merged the queryset-refactor branch into trunk.
This is a big internal change, but mostly backwards compatible with existing
code. Also adds a couple of new features.
Fixed #245, #1050, #1656, #1801, #2076, #2091, #2150, #2253, #2306, #2400, #2430, #2482, #2496, #2676, #2737, #2874, #2902, #2939, #3037, #3141, #3288, #3440, #3592, #3739, #4088, #4260, #4289, #4306, #4358, #4464, #4510, #4858, #5012, #5020, #5261, #5295, #5321, #5324, #5325, #5555, #5707, #5796, #5817, #5987, #6018, #6074, #6088, #6154, #6177, #6180, #6203, #6658
This is the SQL run when calling
get_next_in_order
on a "model" object with _order 24And here's
get_previous_in_order
on the same objectThe patch changes that second query to use DESC instead.