padmatexts/padmaTexts/texts/views.py
2011-03-28 16:10:52 +05:30

13 lines
433 B
Python

# Create your views here.
from models import PadmaText
from django.http import HttpResponse
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.filter(published=True)
return render_to_response("text_list.html", {'texts': texts})