add published boolean
This commit is contained in:
parent
6aaa08b327
commit
454cb6741b
|
@ -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()
|
||||||
|
|
|
@ -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})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user