I use FormEncode very happily... along with a custom solution.

1. For multiple-step logic, I use multiple FormEncode forms.
2. For advanced formatting, my stuff looks like this:

def form(self):
    if request.params.get('m') == 'submit':
        return self._form__submit()
    return self._form__print()

def _form__print():
     return render('form.mako')

@custom_validate(form='_form__print')
def _form__submit(self):
    try:
        if i_encounter_error:
            raise GetPost_Form_Error(value)
    except GetPost_Form_Error, e:
        tweak_c_or_form_results_with( e.value )
        return form_reprint( self, '_form__print' )
    except:
        raise
    return 'yay'

that lets me handle a lot of situations.   if i'm dealing with
formatting multiple error fields, i just populate a dict with errors
and raise at the end.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-disc...@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