X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/1e0e7cfcbfdf5b88839397b1a9a52f3433bff2cf..4174245c6e2a2770aba9fa3451452397eb15a15c:/forum/urls.py?ds=sidebyside diff --git a/forum/urls.py b/forum/urls.py index 309e9a7..c669808 100644 --- a/forum/urls.py +++ b/forum/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import patterns, include, url +# -*- coding: utf-8 -*- +from django.conf.urls import patterns, url from haystack.query import SearchQuerySet from haystack.views import SearchView, search_view_factory from haystack.forms import SearchForm @@ -7,17 +8,19 @@ from pybb.models import Post from .views import AddPostView, EditPostView -urlpatterns = patterns('', +urlpatterns = patterns( + '', url(r'^forum/(?P\d+)/topic/add/$', AddPostView.as_view()), url(r'^post/(?P\d+)/edit/$', EditPostView.as_view()), ) PostsSearchQuerySet = SearchQuerySet().models(Post).highlight() -urlpatterns += patterns('haystack.views', +urlpatterns += patterns( + 'haystack.views', url(r'^szukaj/$', search_view_factory( - view_class = SearchView, - template = 'forum/search_results.html', - searchqueryset = PostsSearchQuerySet, - form_class = SearchForm - ), name='forum_search')) \ No newline at end of file + view_class=SearchView, + template='forum/search_results.html', + searchqueryset=PostsSearchQuerySet, + form_class=SearchForm + ), name='forum_search'))