bornhack-website/news/views.py
2016-06-05 23:20:06 +02:00

16 lines
357 B
Python

from django.views.generic import ListView, DetailView
from . import models
class NewsIndex(ListView):
model = models.NewsItem
queryset = models.NewsItem.objects.public()
template_name = 'news_index.html'
context_object_name = 'news_items'
class NewsDetail(DetailView):
model = models.NewsItem
template_name = 'news_detail.html'