On Thursday, December 6, 2012 4:35:57 AM UTC-5, malthe wrote:
>
> Hey Nicolas, 
>
> I had a realization at some point that form libraries ultimately 
> aren't a joy to work with. 
>
> Instead, I wrote `repoze.formapi` (see docs at 
> http://docs.repoze.org/formapi/). 
>
>
I did something similar.

I wrote pyramid_formencode_classic, which mimics the pylons formencode 
implementation but is much simpler

https://github.com/jvanasco/pyramid_formencode_classic

it doesn't do the form generation, but it will 'reprint' a form on failure.

for the form generation, i just use mako functions

in /-partials/forms.py  i have things like:

    def form_textarea_a
    def form_textfield_a

( 'a' denotes the style )

then when rendering the forms, my templates look like (in psuedocode):

   include /-partials/forms.py as t_forms   
   <form action="/path">
      t_form.form_textfield_a('name',request.form.name)
      t_form.form_textfield_a('email',request.form.email)
   </form>

i wanted the form styles to be mako defs, because it centralizes them but 
also moves them in the source tree to the templates section.  with a lot of 
the widget based form solutions, team members who shouldn't be touching 
backend stuff will need to touch backend stuff.  

-- 
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/-/ZGZ6LdvGvaMJ.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to