Thursday, April 12, 2012

override haystack build_page() function

I'm using django-haystack and want to override build_page() function. here is a url of build_page(). I want to replace the default django paginator with django-paginator. thanks alot :-)



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.
"""


I've written messy code. Will you please help me? thanks



class MyView(SearchView):
def build_page(self):
build_page = super(MyView, self).build_page()
page = self.results
return page




No comments:

Post a Comment