Hi Christoph,

first of all, thanks for your work on an alternative paginator. I'm
currently testing it, and I am pleased so far :-)

However, I found one bug and a minor documentation error for the
module available at http://workaround.org/pylons/paginator/paginate.py.

Bug
=======

The relevant code is in Page.__init__().

$ diff paginate_original.py paginate.py
128c128
<             self.page_count = int(ceil(self.item_count /
self.items_per_page))
---
>             self.page_count = int(ceil(1.0 * self.item_count / 
> self.items_per_page))

In the original paginate.py, integer division is used. For example, if
item_count is 8 and items_per_page is 5, than "item_count /
items_per_page" gives 1 as an int where it should give 1.6 as a float
and thus 2 after ceil(). The best workaround to force true division is
to multiply with "1.0" first [1].


Documentation
=========
For Page.navigator(), the doc string says:

"Either link_format or link_var must be set!"

First, the link_format parameter does not exist (I guess: not
anymore). Second, link_var has a very beautiful default value, so
nothing must be set in advance. :-) On a side node, the paginator.rest
file is more up to date when it talks about adding $
{c.paginator.navigator()} (without parameters) for integrating
navigation into the example.


Cheers,
Michael


[1] PEP 238, http://www.python.org/dev/peps/pep-0238/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to