new exercises
[edumed.git] / forum / urls.py
1 from django.conf.urls import patterns, include, url
2 from haystack.query import SearchQuerySet
3 from haystack.views import SearchView, search_view_factory
4 from haystack.forms import SearchForm
5 from pybb.models import Post
6
7 from .views import AddPostView, EditPostView
8
9
10 urlpatterns = patterns('',
11     url(r'^forum/(?P<forum_id>\d+)/topic/add/$', AddPostView.as_view()),
12     url(r'^post/(?P<pk>\d+)/edit/$', EditPostView.as_view()),
13 )
14
15 PostsSearchQuerySet = SearchQuerySet().models(Post).highlight()
16
17 urlpatterns += patterns('haystack.views',
18     url(r'^szukaj/$', search_view_factory(
19         view_class = SearchView,
20         template = 'forum/search_results.html',
21         searchqueryset = PostsSearchQuerySet,
22         form_class = SearchForm
23     ), name='forum_search'))