Merge lp:~mhall119/loco-team-portal/fix-globalevent-count into lp:loco-team-portal

Proposed by Michael Hall
Status: Merged
Approved by: Adnane Belmadiaf
Approved revision: 521
Merged at revision: 521
Proposed branch: lp:~mhall119/loco-team-portal/fix-globalevent-count
Merge into: lp:loco-team-portal
Diff against target: 12 lines (+1/-1)
1 file modified
loco_directory/events/views.py (+1/-1)
To merge this branch: bzr merge lp:~mhall119/loco-team-portal/fix-globalevent-count
Reviewer Review Type Date Requested Status
Adnane Belmadiaf Approve
Review via email: mp+92873@code.launchpad.net

Commit message

Chris added some query optimizations a while back for the past events page, but that shares a template include with the current events page, which didn't have the same optimization applied to it's view. This adds the same feature to the event_list view.

Description of the change

Chris added some query optimizations a while back for the past events page, but that shares a template include with the current events page, which didn't have the same optimization applied to it's view. This adds the same feature to the event_list view.

To post a comment you must log in.
Revision history for this message
Adnane Belmadiaf (daker) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/events/views.py'
2--- loco_directory/events/views.py 2012-02-09 02:06:11 +0000
3+++ loco_directory/events/views.py 2012-02-13 22:56:25 +0000
4@@ -30,7 +30,7 @@
5 a list with all events (teamevents and globalevents)
6 """
7 team_event_list = TeamEvent.objects.next_events()
8- global_event_list = GlobalEvent.objects.next_events()
9+ global_event_list = GlobalEvent.objects.next_events().annotate(num_teamevents=Count('teamevent'))
10 is_on_lc = launchpad.is_user_on_loco_council(request.user)
11 context = {
12 'team_event_list': team_event_list,

Subscribers

People subscribed via source and target branches