Permalink
Browse files

Add location to event manager select_related

  • Loading branch information...
1 parent b7a9871 commit d5d2473b6361c456a3340af871b00af3504368e8 @tmickel tmickel committed Aug 22, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 airmozilla/manage/views.py
@@ -253,16 +253,18 @@ def events(request):
else:
search_form = forms.EventFindForm()
initiated = (Event.objects.initiated().filter(**creator_filter)
- .order_by('start_time').select_related('category'))
+ .order_by('start_time')
+ .select_related('category', 'location'))
upcoming = (Event.objects.upcoming().filter(**creator_filter)
- .order_by('start_time').select_related('category'))
+ .order_by('start_time').select_related('category', 'location'))
live = (Event.objects.live().filter(**creator_filter)
- .order_by('start_time').select_related('category'))
+ .order_by('start_time').select_related('category', 'location'))
archiving = (Event.objects.archiving().filter(**creator_filter)
- .order_by('-archive_time').select_related('category'))
+ .order_by('-archive_time')
+ .select_related('category', 'location'))
archived = (Event.objects.archived(include_removed=True)
.filter(**creator_filter) .order_by('-archive_time')
- .select_related('category'))
+ .select_related('category', 'location'))
archived_paged = paginate(archived, request.GET.get('page'), 10)
return render(request, 'manage/events.html', {
'initiated': initiated,

0 comments on commit d5d2473

Please sign in to comment.