from django.urls import path
from django.views.generic import DetailView, ListView
from news.models import NewsItem

from . import views

urlpatterns = [
    path('', views.all_news),
    path('x/',
         ListView.as_view(
             queryset=NewsItem.objects.filter(
                 category='s').order_by('-date'),
             context_object_name='latest_news_list',
             template_name='news/index.html')),
    path('<int:pk>/', views.detail),
    path('profile/<int:pk>/', views.profile),
    path('statement/<int:pk>/', views.statement),
    path('dump/', views.dump),
    #        DetailView.as_view(
    #        model=Story,
    #        template_name='news/detail.html')),
]
