我正在使用django-haystack
並且想要覆蓋build_page()
函數。這裏是一個build_page()的網址。我想用django-paginator
替換默認的django paginator
。非常感謝:-)override haystack build_page()函數
def build_page(self):
"""
Paginates the results appropriately.
In case someone does not want to use Django's built-in pagination, it
should be a simple matter to override this method to do what they would
like.
"""
我已經寫了凌亂的代碼。你能幫我嗎?感謝
class MyView(SearchView):
def build_page(self):
build_page = super(MyView, self).build_page()
page = self.results
return page
我在Haystack 2.0.0上測試了這個解決方案,我可以證實它的工作原理。謝謝eli。 – 2013-11-23 01:18:41