Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #845 (closed defect: duplicate)

Opened 12 years ago

Last modified 11 years ago

Paginate is not working

Reported by: kevin Owned by: anonymous
Priority: normal Milestone: 1.5
Component: TurboGears Version: 0.9a5
Severity: normal Keywords:
Cc:

Description

I've added some debug logging to turbogears.paginate and it would appear that the paging parameters are not making it in to the decorator's code.

paginate could really use a test like the one in test_expose

Attachments

test.paginate.diff Download (2.2 KB) - added by Claudio Martinez <martinezc@…> 12 years ago.
Test suite for paginate
tests_and_fix.diff Download (3.6 KB) - added by Claudio Martinez <martinezc@…> 12 years ago.
Tests with strict_parameters on and off and a fix to the problem
paginate_alternative_workaround_plus_enhacements.patch Download (15.3 KB) - added by claudio.martinez 12 years ago.
Alternative workaround.
PaginateNewDemo.zip Download (38.5 KB) - added by claudio.martinez 12 years ago.
Demo project for the last patch.
paginate.py.1670.patch Download (1.6 KB) - added by randall@… 12 years ago.
patch with SQLAlchemy support
paginate.py.1670.2.patch Download (1.7 KB) - added by randall@… 12 years ago.
patch with SQLAlchemy support (with fix)

Change History

comment:1 Changed 12 years ago by kevin

  • Milestone changed from 0.9a6 to 1.0b1

comment:2 Changed 12 years ago by Claudio Martinez <martinezc@…>

I've just tested it on a clean checkout with the demo project from #719 and it's working ok.

I'll submit a patch with the tests soon.

And sorry for the delay, I was out of town.

comment:3 Changed 12 years ago by anonymous

I found the problem.

Looks like that when tg.strict_parameters is disabled, the adapt_args call deletes the parameters that paginate uses.

I'll submit a test module. You can trigger the error there disabling the strict params option. Otherwise it works perfectly.

I'll work on a solution

Changed 12 years ago by Claudio Martinez <martinezc@…>

Test suite for paginate

Changed 12 years ago by Claudio Martinez <martinezc@…>

Tests with strict_parameters on and off and a fix to the problem

comment:4 Changed 12 years ago by rob.haswell

tests_and_fix.diff does not work fully as expected. If you are using the default() method to do URL-rewriting, the patch still does not work as it is reading from the HTTP parameters, not the parameters that the paginated method is called with.

A different solution needed I'm afraid :-(

comment:5 Changed 12 years ago by claudio.martinez

Actually, that fix is more a workaround than a fix.

Can you mail me (martinezc@…) a demo project that fails with url rewriting? I'll give it a check.

comment:6 Changed 12 years ago by claudio.martinez

I'm adding a new patch with a different workaround (I made adapt_call ignore tg_paginate_ parameters). It has new stuff (stackable paginators) and it's backwards compatible if you are using PagineDataGrid?. Give it a try, it may solve your problem. Added tests too.

Also, I'm adding a demo project. It needs this last patch to work.

Changed 12 years ago by claudio.martinez

Alternative workaround.

Changed 12 years ago by claudio.martinez

Demo project for the last patch.

Changed 12 years ago by randall@…

patch with SQLAlchemy support

Changed 12 years ago by randall@…

patch with SQLAlchemy support (with fix)

comment:7 Changed 12 years ago by fredlin

Is this bug solved?

comment:8 Changed 12 years ago by jorge.vargas

  • Component changed from CherryPy to TurboGears
  • Milestone changed from 1.0b1 to 1.0b2

comment:9 Changed 12 years ago by alberto

  • Milestone changed from 1.0b2 to 1.1

comment:10 Changed 12 years ago by jorge.vargas

  • Status changed from new to closed
  • Resolution set to duplicate

after #1115 much of this code changed please check out of that fixed your issue

Note: See TracTickets for help on using tickets.