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