From 454cb6741be418277d00266ee95bc6a6e14ed4db Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 28 Mar 2011 16:10:52 +0530 Subject: [PATCH] add published boolean --- padmaTexts/texts/models.py | 1 + padmaTexts/texts/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/padmaTexts/texts/models.py b/padmaTexts/texts/models.py index 9eb6d9a..d273c8c 100644 --- a/padmaTexts/texts/models.py +++ b/padmaTexts/texts/models.py @@ -1,6 +1,7 @@ from django.db import models class PadmaText(models.Model): + published = models.BooleanField(default=False) date = models.DateField(null=True) title = models.CharField(max_length=512) slug = models.SlugField() diff --git a/padmaTexts/texts/views.py b/padmaTexts/texts/views.py index 9b86720..e1ec8ec 100644 --- a/padmaTexts/texts/views.py +++ b/padmaTexts/texts/views.py @@ -8,5 +8,5 @@ def text(request, slug): return render_to_response("text_embed.html", {'text': text}) def texts(request): - texts = PadmaText.objects.all() + texts = PadmaText.objects.filter(published=True) return render_to_response("text_list.html", {'texts': texts})