Source

copelco / lib / copelco / apps / default / views.py

Diff from to

lib/copelco/apps/default/views.py

 from django.template import Context, RequestContext, loader
 from django.shortcuts import render_to_response, get_object_or_404
 
+from copelco.apps.aggregator.models import FeedItem
+from copelco.apps.flickr.models import PhotoSize
+
 
 def home(request):
-    context = {}
+    feed_items = FeedItem.objects.order_by('-date_modified')[:10]
+    photos = PhotoSize.objects.filter(type='medium',
+                                      width__gt=500).order_by('?')[:10]
+    context = {'feed_items': feed_items, 'photos': photos}
     return render_to_response('home.html', context,
                               context_instance=RequestContext(request))