# HG changeset patch # User Steve Losh # Date 1250893747 14400 # Node ID ae2856e8f8dc4d00a4265986e84b83f8cd188147 # Parent 07711504f5f9458668d5d4bf5489237f53514196 Split the projects by type really fast. This can be done better. diff -r 07711504f5f9 -r ae2856e8f8dc projects/views.py --- a/projects/views.py Thu Jul 30 06:10:18 2009 -0400 +++ b/projects/views.py Fri Aug 21 18:29:07 2009 -0400 @@ -17,8 +17,10 @@ { 'project': project, 'comments': comments }) def list(request): - projects = Project.objects.all().order_by('-posted') - return render_to_response('projects/list.html', { 'projects': projects, }) + photo = Project.objects.filter(type='photography').order_by('-posted') + programming = Project.objects.filter(type='programming').order_by('-posted') + return render_to_response('projects/list.html', + {'photo': photo, 'programming': programming}) def comment(request): fields = request.POST diff -r 07711504f5f9 -r ae2856e8f8dc templates/projects/list.html --- a/templates/projects/list.html Thu Jul 30 06:10:18 2009 -0400 +++ b/templates/projects/list.html Fri Aug 21 18:29:07 2009 -0400 @@ -3,7 +3,31 @@ {% block content %}
- {% for project in projects %} +
+

Programming

+

 

+
+ {% for project in programming %} +
+

+ + {{ project.name|typogrify }} + +

+

{{ project.snip|typogrify }}

+
+ {% endfor %} + +
+

 

+

 

+
+ +
+

Photography

+

 

+
+ {% for project in photo %}