﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13986	When using the object_list you can not pass paginate_by in the url	Dougal Matthews	Dougal Matthews	"In trying to vary the page size in the url, we tried to pass in the paginate_by in the url. The Pagination class does not convert arguements into ints and fails.

This is the documented behaviour however the view would be more generic if this could be varied like this.

This can be reproduced by adding the following to your urls.py

{{{
urlpatterns += patterns('django.views.generic.list_detail',
    (r'^object_list/(?P<paginate_by>[0-9]?)/page(?P<page>[0-9]+)/$', 'object_list', object_list_dict),
)
}}}

A request to this url will cause the following traceback

{{{
======================================================================
ERROR: test_finds_past (regressiontests.views.tests.generic.object_list.ObjectDetailTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/Users/dougal/Django/django_src/tests/regressiontests/views/tests/generic/object_list.py"", line 17, in test_finds_past
    response = self.client.get('/views/object_list/%s/page1/' % paginate_by)
  File ""/Users/dougal/Django/django_src/django/test/client.py"", line 290, in get
    response = self.request(**r)
  File ""/Users/dougal/Django/django_src/django/core/handlers/base.py"", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File ""/Users/dougal/Django/django_src/django/views/generic/list_detail.py"", line 60, in object_list
    page_obj = paginator.page(page_number)
  File ""/Users/dougal/Django/django_src/django/core/paginator.py"", line 41, in page
    if top + self.orphans >= self.count:
TypeError: coercing to Unicode: need string or buffer, int found

----------------------------------------------------------------------
}}}

the object_list generic view already converts the page argument to an int. It would then make sense to convert paginate_by in the same place in the view
"		closed	Generic views	1.2		fixed			Unreviewed	1	0	0	0	0	0
