padmatexts/padmaTexts/texts/views.py

13 lines
433 B
Python
Raw Normal View History

2010-11-11 00:16:21 +00:00
# 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})
2010-11-11 00:34:17 +00:00
def texts(request):
2011-03-28 10:40:52 +00:00
texts = PadmaText.objects.filter(published=True)
2010-11-11 00:34:17 +00:00
return render_to_response("text_list.html", {'texts': texts})