Form Library for Pyramid on Python 3

263 views
Skip to first unread message

denys_br

unread,
Jul 25, 2012, 4:34:57 AM7/25/12
to pylons-...@googlegroups.com
Is there good replace for pyramid_simpleform that works on Python 3?

Robert Forkel

unread,
Jul 25, 2012, 5:21:03 AM7/25/12
to pylons-...@googlegroups.com
deform [1] should work with python3. But not having used simpleform
myself I cannot say whether it's a good replacement. From my
experience I'd say if you need full control of the HTML generated by
the form lib, deform may not fit the bill.
regards,
robert


[1] http://pypi.python.org/pypi/deform/

On Wed, Jul 25, 2012 at 10:34 AM, denys_br <bru...@gmail.com> wrote:
> Is there good replace for pyramid_simpleform that works on Python 3?
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pylons-discuss/-/dtKPdf8cdLkJ.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discus...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.

Randall Leeds

unread,
Jul 25, 2012, 3:10:32 PM7/25/12
to pylons-...@googlegroups.com
On Wed, Jul 25, 2012 at 2:21 AM, Robert Forkel <xrot...@googlemail.com> wrote:
> deform [1] should work with python3. But not having used simpleform
> myself I cannot say whether it's a good replacement. From my
> experience I'd say if you need full control of the HTML generated by
> the form lib, deform may not fit the bill.
> regards,
> robert

I disagree. It is rather easy to customize deform to use a different template.
In common cases, it is as simple as copying the template from deform
into your own project and modifying it. Adjusting the template path
accordingly will cause deform to pick up your override. See the
deform_bootstrap package for an example.

One-off customizations can also be achieved with slightly more
digging, passing a custom template keyword to the constructor for any
widget.

Robert Forkel

unread,
Jul 25, 2012, 3:32:11 PM7/25/12
to pylons-...@googlegroups.com
You are right. There are ways to customize the HTML generated by
deform - and I'm using all the mechanisms you enumerated and quite
like it. But there certainly are things that are hard to achieve. E.g.
if you don't like the approach of pretty much all form items being
generated as li elements within ul containers you'd have to replace
quite a few templates, or if you want some controls being rendered
side by side, others below each other, or if you want custom sequence
widgets. But possibly these things are hard with other form libraries
as well.
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.

Randall Leeds

unread,
Jul 26, 2012, 4:53:26 PM7/26/12
to pylons-...@googlegroups.com


On Jul 25, 2012 2:32 PM, "Robert Forkel" <xrot...@googlemail.com> wrote:
>
> You are right. There are ways to customize the HTML generated by
> deform - and I'm using all the mechanisms you enumerated and quite
> like it. But there certainly are things that are hard to achieve. E.g.
> if you don't like the approach of pretty much all form items being
> generated as li elements within ul containers you'd have to replace
> quite a few templates, or if you want some controls being rendered
> side by side, others below each other, or if you want custom sequence
> widgets. But possibly these things are hard with other form libraries
> as well.

I have experienced some of this pain.  Please let us know if you find compelling alternatives.

Robert Forkel

unread,
Jul 27, 2012, 1:13:52 AM7/27/12
to pylons-...@googlegroups.com
right now, at my workplace we are still on deform, but explore the
possibility of custom widgets.
E.g. we build widgets that will take a sqlalchemy model instance and
render multiple form items to edit it.
This does still feel like too much code for what we want to achieve,
but there's potential to factor out boilerplate code (like wrapping
all form items in a mapping).
Of course this means that select boxes or text inputs are created in
more than one place/template, but then again, this kind of control was
why we started down that road.
We don't have custom widgets yet, that are as complex as comprising
sequences, and i guess at this point we will look for alternatives
again.
Reply all
Reply to author
Forward
0 new messages