Hi Toshio

On Dec 12, 2007 5:59 PM, Toshio Kuratomi <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> Another developer and I were having two separate issues with the
> paginate decorator so I wrote a patch that addresses both.  I wanted to
> toss it out here for discussion:
>
> My problem:
> * I have some URLs that I want to return paginated data for when a user
> views it as HTML but want to return the entire list of data when a
> script requests JSON data.  Currently there isn't a way to specify that
> paginate should return all the data.


You will use dynamic_limit, right ?


> His problem:
> * Search indexers have somehow decided that they are going to index some
> of his paginated pages with ?tg_paginate_limit=0 at the end.  This
> causes his log to fill up with a bunch of zeroDivisionError tracebacks[1]_
>
> I'm attaching a patch against TG-1.0.3 that sets the
> tg_paginate_limit=row_count when the limit passed in is 0.  This fixes
> my problem by giving me something that I can use to return all data
> (whereas both positive and negative values already have a meaning to
> paginate) and fixes his problem because tg_paginate_limit now has a
> meaning when passed in 0.
>
> Anyone have thoughts on this?  Is this properly discussed in a bug report?

I agree we should handle this dangerous situation.

Would you please open a ticket and attach your patch ?
(your patch is simple, but our policy is "try to never fix a bug
without a related ticket, so we
can reference it in changelog"...   ;)



> .. _[1]: https://hosted.fedoraproject.org/projects/bodhi/ticket/150
>
> Thanks,
> -Toshio


We thank you...



[]s
Roger

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to