librelist archives

« back to archive

flask-admin - pagination problems

flask-admin - pagination problems

From:
Wolf-Dietrich Seidlitz
Date:
2011-09-15 @ 22:03
I added the flask admin extension to my app. All models with more
than 25 entries in their respective tables cannot be opened by the admin app.
An error like this is raised:

BuildError: ('list_view', {'model_name': u'Personen', 'page': 2}, None)

The error is raised, when the following line in "_paginationhelpers.html"
is processed:

<a href="{{ url_for(endpoint, page=page, **kwargs) }}">{{ page }}</a>

I have inspected the arguments to "render_template()" in "list_view()"
(Flask_Admin-0.1.2-py2.7.egg/flaskext/admin/__init__.py line 165):
nothing unusual.

Regards,
Wolf

Re: [flask] flask-admin - pagination problems

From:
Andy Wilson
Date:
2011-09-16 @ 06:05
On Thu, Sep 15, 2011 at 5:03 PM, Wolf-Dietrich Seidlitz
<wdseidlitz@gmx.de>wrote:

> I added the flask admin extension to my app. All models with more
> than 25 entries in their respective tables cannot be opened by the admin
> app.
> An error like this is raised:
>
> BuildError: ('list_view', {'model_name': u'Personen', 'page': 2}, None)
>
> The error is raised, when the following line in "_paginationhelpers.html"
> is processed:
>
> <a href="{{ url_for(endpoint, page=page, **kwargs) }}">{{ page }}</a>
>
> I have inspected the arguments to "render_template()" in "list_view()"
> (Flask_Admin-0.1.2-py2.7.egg/flaskext/admin/__init__.py line 165):
> nothing unusual.
>



Hi Wolf.

This is my fault. It is a rather stupid bug. The views aren't getting found
in the pagination url_for calls because they aren't using the right
endpoints. They should be '.list_view' instead of 'list_view'. ralfonso sent
in a fix for this a while ago but I was slow to pull it and upload it to
pypi. If you grab the latest version, 0.1.4, from pypi then you should be
good to go.