Pyramid incompatibilities with WebHelpers

30 views
Skip to first unread message

Mike Orr

unread,
Nov 6, 2010, 1:06:11 PM11/6/10
to pylons...@googlegroups.com, Christoph Haas
A few incompatibilities have been discovered between Pyramid and WebHelpers.

http://bitbucket.org/bbangert/webhelpers/issue/54/pyramid-incompatibilities-paginate-flash
http://bitbucket.org/bbangert/webhelpers/issue/53/paginate-in-pyramid

Paginate, Flash, and everything in webhelpers.pylonslib depend on
Pylons' magic globals, which don't exist in Pyramid. For Paginate,
you'll have to write a callback function wrapping
``pyramid.url.route_url()``; you'll need a separate function for each
route. For Flash and pylonslib, you'll have to modify the helpers to
pass the request/response/session in a Pyramid-friendly way.

I haven't decided yet how to accommodate these in WebHelpers. I'll
probably modify Paginate and add another fallback. As for pylonslib,
I'm not sure whether to create a pyramidlib directory or make them all
generic.

* Flash: This is frequently-used enough to go into Pyramid directly.

* Grid: A generic version is in webhelpers.html.grid.

* Minify: I've never used this. Can it go into Pyramid.

* Secure_form: I've never used this. Can it go into Pyramid? Pylons
imports it into pylons.decorators.secure .

--
Mike Orr <slugg...@gmail.com>

Chris McDonough

unread,
Nov 6, 2010, 1:32:26 PM11/6/10
to pylons...@googlegroups.com, Christoph Haas
On Sat, 2010-11-06 at 10:06 -0700, Mike Orr wrote:
> A few incompatibilities have been discovered between Pyramid and WebHelpers.
>
> http://bitbucket.org/bbangert/webhelpers/issue/54/pyramid-incompatibilities-paginate-flash
> http://bitbucket.org/bbangert/webhelpers/issue/53/paginate-in-pyramid
>
> Paginate, Flash, and everything in webhelpers.pylonslib depend on
> Pylons' magic globals, which don't exist in Pyramid. For Paginate,
> you'll have to write a callback function wrapping
> ``pyramid.url.route_url()``; you'll need a separate function for each
> route. For Flash and pylonslib, you'll have to modify the helpers to
> pass the request/response/session in a Pyramid-friendly way.
>
> I haven't decided yet how to accommodate these in WebHelpers. I'll
> probably modify Paginate and add another fallback. As for pylonslib,
> I'm not sure whether to create a pyramidlib directory or make them all
> generic.
>
> * Flash: This is frequently-used enough to go into Pyramid directly.

Sure. Instead of something that uses thread locals, I'd like to make
this an API of the session object (e.g. session.flash(...)). If someone
can propose a reasonable set of methods on the session object for
flashing I can add them.

> * Grid: A generic version is in webhelpers.html.grid.
>
> * Minify: I've never used this. Can it go into Pyramid.
>
> * Secure_form: I've never used this. Can it go into Pyramid? Pylons
> imports it into pylons.decorators.secure .

I think maybe the functionality of most of this stuff should be
reintroduced as separate libraries (or maybe not at all).

- C


Reply all
Reply to author
Forward
0 new messages