On Fri, Jun 15, 2007 at 12:08:31PM -0700, Mike Orr wrote:
> There's a bug in Christoph Haas's alternative paginator
> (http://workaround.org/pylons/paginator/)
> if the result set contains zero records and 'show_if_single_page' is true.
> 
> Module inews.lib.paginator:245 in navigator
> text = '%s' % (self.first_page+(start_with_one and 1))
> TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Oops.

> self.first_page was set to None in line 121.
> 
> I think the solution is to add a stanza after this one:
> 
>         # Don't show navigator if there is no more than one page
>         if self.page_count <= 1 and show_if_single_page == False:
>             return ''
> 
> adding at line 237:
> 
>         # If zero result records, return a fake navigator
>         return '<strong>[1]</strong>'

Not sure what's better. If there's nothing to navigate I personally
prefer not to see a useless navigator. But I think I can make this
behavior customizable through options.

I'll fix that shortly. I have added support for jQuery, too, because I
have averted from scriptaculous/prototype. There's still your question
on my list on how to degrade gracefully if there is no Javascript
support (as you asked for recently) anyway. Suggestions welcome if
anyone's quicker.

Kindly
 Christoph


--~--~---------~--~----~------------~-------~--~----~
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