text list

This commit is contained in:
sanj 2010-11-11 06:04:17 +05:30
parent 89c6273c53
commit 03e22fa718
3 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
{% for t in texts %}
<a href="{{t.get_absolute_url}}" title="{{t.title}}">{{ t.title }}</a><br />
{% endfor %}
</body>
</html>

View File

@ -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})

View File

@ -9,6 +9,7 @@ admin.autodiscover()
urlpatterns = patterns('',
# Example:
(r'^admin/', include(admin.site.urls)),
(r'^$', 'texts.views.texts'),
)