jmcclell / django-bootstrap-pagination

Django template tag for rendering Page objects as Bootstrap pagination HTML
MIT License
212 stars 83 forks source link

show_index_range option adds additional queries by evaluating page.paginator.objectlist #51

Closed bboogaard closed 8 years ago

bboogaard commented 8 years ago

Since updating to v. 1.6.0 I get additional queries when passing a page object to bootstrap_paginate. This is caused by evaluating the object_list attribute of the paginator of that page object (line 200 in templatetags/bootstrap_pagination.py). Could you change it so that it only is evaluated when you have the show_index_range option (passed in)?

kvdveer commented 8 years ago

Version 1.6.1 fixes the issue in the way you proposed.(on pypi)

Could you elaborate a bit on why this is an issue in the first place? I'd suspect the object list from which the paginator was constructed would be evaluated anyway elsewhere in the same page?