diff gpp/weblinks/views.py @ 20:c0d0779b266f

Created a template tag for the latest weblinks: latest_weblinks. This necessitated adding a get_absolute_url function for the Link model along with a new view for it.
author Brian Neal <bgneal@gmail.com>
date Sun, 19 Apr 2009 20:41:37 +0000
parents dbd703f7d63a
children 884839ddbfde
line wrap: on
line diff
--- a/gpp/weblinks/views.py	Sun Apr 19 20:10:00 2009 +0000
+++ b/gpp/weblinks/views.py	Sun Apr 19 20:41:37 2009 +0000
@@ -224,3 +224,13 @@
       'search_form': SearchForm(),
       }, 
       context_instance = RequestContext(request))
+
+#######################################################################
+
+def link_detail(request, id):
+    link = get_object_or_404(Link, pk=id)
+    return render_to_response('weblinks/link_detail.html', {
+        'link': link, 
+        'search_form': SearchForm(),
+        },
+        context_instance = RequestContext(request))