from django.shortcuts import render

from django.views.generic import ListView, DetailView
from .models import Content

# class ContentsListView(ListView):
#     model = Content
#     template_name = 'content/list_contents.html'
#     context_object_name = 'contents'

#     def get_queryset(self):
#         return Content.objects.order_by('-published_date')[:10]

#     def get_context_data(self, **kwargs):
#         context = super().get_context_data(**kwargs)
#         context['articles'] = Content.objects.filter(content_type='article').order_by('-published_date')[:5]
#         context['news_list'] = Content.objects.filter(content_type='news').order_by('-published_date')[:5]
#         return context

# class ContentDetailView(DetailView):
#     model = Content
#     template_name = 'content/content_detail.html'
#     context_object_name = 'content'