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
8 from .views import AddPostView, EditPostView
11 urlpatterns = patterns(
13 url(r'^forum/(?P<forum_id>\d+)/topic/add/$', AddPostView.as_view()),
14 url(r'^post/(?P<pk>\d+)/edit/$', EditPostView.as_view()),
17 PostsSearchQuerySet = SearchQuerySet().models(Post).highlight()
19 urlpatterns += patterns(
21 url(r'^szukaj/$', search_view_factory(
22 view_class=SearchView,
23 template='forum/search_results.html',
24 searchqueryset=PostsSearchQuerySet,
26 ), name='forum_search'))