frankban / django-endless-pagination

This project is deprecated: please use https://github.com/shtalinberg/django-el-pagination
MIT License
251 stars 108 forks source link

Render with Context, instead of RequestContext #74

Open zhang-z opened 10 years ago

zhang-z commented 10 years ago

hi guys, thanks for the great package. I want to suggest one improvement:

Referring to the last line of "endless_pagination/models.py/EndlessPage.unicode":

return template.render(RequestContext(self._request, context))

The EndlessPage object renders with RequestContext. Under this implementation, all context_processors are executed many times in a view. In my project, one context_processor even hits DB. This is a significant cost. As I saw, neither "current_link.html" nor "page_link.html" is using "request". So I think simply replacing RequestContext with Context will be an improvement.