add published boolean

This commit is contained in:
Sanj 2011-03-28 16:10:52 +05:30
parent 6aaa08b327
commit 454cb6741b
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
from django.db import models from django.db import models
class PadmaText(models.Model): class PadmaText(models.Model):
published = models.BooleanField(default=False)
date = models.DateField(null=True) date = models.DateField(null=True)
title = models.CharField(max_length=512) title = models.CharField(max_length=512)
slug = models.SlugField() slug = models.SlugField()

View File

@ -8,5 +8,5 @@ def text(request, slug):
return render_to_response("text_embed.html", {'text': text}) return render_to_response("text_embed.html", {'text': text})
def texts(request): def texts(request):
texts = PadmaText.objects.all() texts = PadmaText.objects.filter(published=True)
return render_to_response("text_list.html", {'texts': texts}) return render_to_response("text_list.html", {'texts': texts})