Mercurial > public > sg101
comparison gpp/urls.py @ 415:d4d167876c25
Fixing #205; search result pagination wasn't including models. Created a custom model search form so that the query term and model selections would persist across pages.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 10 Apr 2011 00:32:14 +0000 |
parents | 2a03c69792d8 |
children | 524fd1b3919a |
comparison
equal
deleted
inserted
replaced
414:b1f939b1fb01 | 415:d4d167876c25 |
---|---|
1 from django.conf.urls.defaults import * | 1 from django.conf.urls.defaults import * |
2 from django.conf import settings | 2 from django.conf import settings |
3 from django.contrib import admin | 3 from django.contrib import admin |
4 from django.views.decorators.cache import cache_page | 4 from django.views.decorators.cache import cache_page |
5 | 5 |
6 from haystack.views import SearchView, search_view_factory | 6 from haystack.views import search_view_factory |
7 | 7 |
8 from news.feeds import LatestNewsFeed | 8 from news.feeds import LatestNewsFeed |
9 from forums.feeds import ForumsFeed | 9 from forums.feeds import ForumsFeed |
10 from custom_search import ModelSearchView, CustomModelSearchForm | |
10 | 11 |
11 | 12 |
12 admin.autodiscover() | 13 admin.autodiscover() |
13 | 14 |
14 urlpatterns = patterns('', | 15 urlpatterns = patterns('', |
49 (r'^ygroup/', include('ygroup.urls')), | 50 (r'^ygroup/', include('ygroup.urls')), |
50 ) | 51 ) |
51 | 52 |
52 # Haystack search views | 53 # Haystack search views |
53 urlpatterns += patterns('haystack.views', | 54 urlpatterns += patterns('haystack.views', |
54 url(r'^search/$', search_view_factory(view_class=SearchView, load_all=True), | 55 url(r'^search/$', |
56 search_view_factory(view_class=ModelSearchView, | |
57 form_class=CustomModelSearchForm, load_all=True), | |
55 name='haystack_search'), | 58 name='haystack_search'), |
56 ) | 59 ) |
57 | 60 |
58 | 61 |
59 if settings.DEBUG: | 62 if settings.DEBUG: |