from django.conf.urls import url
from django.views.generic import ListView
from projects.models.base import Project

from . import views

app_name = "project"

urlpatterns = [
    url(
        r'data/(?P<id>\d+)/$',
        views.data_json
    ),
    url(
        r'gifs/(?P<slug>[-\w]+)/$',
        views.gif_detail
    ),
    url(
        r'(?P<slug>[-\w]+)/$',
        views.detail
    ),
    url(
        r'^$',
        ListView.as_view(
            queryset=Project.objects.filter(status__exact=1).order_by('-pub_date'),
            template_name="archives/projects.html",
        )
    ),
]