From 03e22fa718c85337595328fb6d7a532b80a2488b Mon Sep 17 00:00:00 2001 From: sanj Date: Thu, 11 Nov 2010 06:04:17 +0530 Subject: [PATCH] text list --- padmaTexts/templates/text_list.html | 11 +++++++++++ padmaTexts/texts/views.py | 4 ++++ padmaTexts/urls.py | 1 + 3 files changed, 16 insertions(+) create mode 100644 padmaTexts/templates/text_list.html diff --git a/padmaTexts/templates/text_list.html b/padmaTexts/templates/text_list.html new file mode 100644 index 0000000..215ff03 --- /dev/null +++ b/padmaTexts/templates/text_list.html @@ -0,0 +1,11 @@ + + + + + + + {% for t in texts %} + {{ t.title }}
+ {% endfor %} + + diff --git a/padmaTexts/texts/views.py b/padmaTexts/texts/views.py index ff160b0..9b86720 100644 --- a/padmaTexts/texts/views.py +++ b/padmaTexts/texts/views.py @@ -6,3 +6,7 @@ from django.shortcuts import get_object_or_404, render_to_response def text(request, slug): text = get_object_or_404(PadmaText, slug=slug) return render_to_response("text_embed.html", {'text': text}) + +def texts(request): + texts = PadmaText.objects.all() + return render_to_response("text_list.html", {'texts': texts}) diff --git a/padmaTexts/urls.py b/padmaTexts/urls.py index 685a966..d067b73 100644 --- a/padmaTexts/urls.py +++ b/padmaTexts/urls.py @@ -9,6 +9,7 @@ admin.autodiscover() urlpatterns = patterns('', # Example: (r'^admin/', include(admin.site.urls)), + (r'^$', 'texts.views.texts'), )