Permalink
Browse files

Fixing static tools page

Projects can now have multiple tools
  • Loading branch information...
1 parent d2c9b20 commit 2e9a83302f230f6304af8d90b8338dfe9f6caac4 @andrewhayward committed Jun 7, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 make_mozilla/tools/views.py
@@ -5,9 +5,14 @@
def index_static(request):
- thimble_projects = projects.models.Project.objects.filter(tool__slug='thimble').order_by('?')[:3]
- goggles_projects = projects.models.Project.objects.filter(tool__slug='x-ray-goggles').order_by('?')[:3]
- popcorn_projects = projects.models.Project.objects.filter(tool__slug='popcorn').order_by('?')[:3]
+ thimble_qs = models.Tool.objects.filter(slug='thimble')
+ thimble_projects = projects.models.Project.objects.filter(tools__in=thimble_qs).order_by('?')[:3]
+
+ goggles_qs = models.Tool.objects.filter(slug='x-ray-goggles')
+ goggles_projects = projects.models.Project.objects.filter(tools__in=goggles_qs).order_by('?')[:3]
+
+ popcorn_qs = models.Tool.objects.filter(slug='popcorn')
+ popcorn_projects = projects.models.Project.objects.filter(tools__in=popcorn_qs).order_by('?')[:3]
return jingo.render(request, 'tools/index_static.html', {
'projects': {

0 comments on commit 2e9a833

Please sign in to comment.