Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#24263 closed Cleanup/optimization (fixed)

Optimization: django.views.generic.dates.BaseDateDetailView

Reported by: EugeneM Owned by: nobody
Component: Generic views Version: 1.7
Severity: Normal Keywords: Optimization BaseDateDetailView
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I guess you need to use a patch (see attach) to prevent running an excess query to DB because of comparison

Attachments (2)

django-1.7.3.patch (799 bytes ) - added by EugeneM 10 years ago.
Patch
24263.diff (1.5 KB ) - added by EugeneM 10 years ago.
Patch with test

Download all attachments as: .zip

Change History (7)

by EugeneM, 10 years ago

Attachment: django-1.7.3.patch added

Patch

comment:1 by Tim Graham, 10 years ago

Could you add a regression test using assertNumQueries() to demonstrate what has changed?

by EugeneM, 10 years ago

Attachment: 24263.diff added

Patch with test

comment:2 by EugeneM, 10 years ago

It looks like you can use this patch for the different versions of Django

Last edited 10 years ago by EugeneM (previous) (diff)

comment:3 by Tim Graham, 10 years ago

Triage Stage: UnreviewedReady for checkin
Type: UncategorizedCleanup/optimization

comment:4 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 118b11221f7f632b4d0e6e976c87f563746ec211:

Fixed #24263 -- Prevented extra queries on BaseDateDetailView with a custom queryset.

Thanks jekka-ua for the report and patch.

comment:5 by Tim Graham <timograham@…>, 10 years ago

In 9ffe013caa9360183cdb948b8e03c9c2a0da5417:

[1.8.x] Fixed #24263 -- Prevented extra queries on BaseDateDetailView with a custom queryset.

Thanks jekka-ua for the report and patch.

Backport of 118b11221f7f632b4d0e6e976c87f563746ec211 from master

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