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
7 from .views import AddPostView, EditPostView
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()),
15 PostsSearchQuerySet = SearchQuerySet().models(Post).highlight()
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'))