#2429: paginate() breaks when calling a method with multiple keyword arguments
------------------------+---------------------------------------------------
Reporter: pitrou | Owner:
Type: defect | Status: new
Priority: normal | Milestone: __unclassified__
Component: TurboGears | Version: 2.0.3
Severity: normal | Keywords:
------------------------+---------------------------------------------------
Suppose you have the following declaration in own of your controllers:
{{{
@expose()
@paginate('foobar')
def list(self, x=None, y=None, submit=None):
# do stuff with self
}}}
Then it will break as soon as you call the method with an URL with more
than one parameter such as `.../list?x=1&y=2`, because `self` will get
replaced with one of the URL parameters. This is because of a bug of the
parameter replacement logic in paginate() (whose purpose I don't exactly
understand). It's a simple off-by-one error: the zeroth element of the
argument specification of the decorated function is skipped, but the
corresponding zeroth element of *args is not. The attached patch fixes the
problem.
--
Ticket URL: <http://trac.turbogears.org/ticket/2429>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en