993095688a0c3ed7f3b3b0e9e368445552e13509
[prawokultury.git] / questions / urls.py
1 # -*- coding: utf-8 -*-
2 # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 from django.conf.urls import patterns, url
6 from django.views.generic import DetailView, ListView, TemplateView
7 from .models import Question
8 from .views import QuestionFormView
9
10 urlpatterns = patterns('',
11     url(r'^$',
12         ListView.as_view(queryset=Question.objects.filter(published=True
13             ).order_by('-published_at')),
14         name="questions"
15     ),
16     url(r'^(?P<pk>\d+)/$',
17         DetailView.as_view(model=Question),
18         name="questions_question"),
19     url(r'^pytanie/$',
20         QuestionFormView.as_view(),
21         name="questions_form",
22     ),
23     url(r'^pytanie/dziekujemy/$',
24         TemplateView.as_view(
25             template_name="questions/question_thanks.html",
26         ),
27         name="questions_thanks"
28     ),
29 )