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

17 lines
395 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'
context_object_name = 'news_item'