On 06/23/2010 09:06, cropr wrote:
Just for what it is worth

I don' t use Formencode in the 3 pylons websites I have.  For me it
tries to solve the form issue at the wrong place in the wrong way.

Generating a form in a html template is better than with FormEncode.
It is readable by non Python humans (they exist) and requires less
typing (<select>  clauses being the exception, but here I created my
own small helper function) and there are thousand of tools to support
the developer.  It gives the possibility to split the work in 2: one
part for a graphical artist, who is an expert in CSS and javascript
and one part for the web developer, who masters pylons and databases.

I am validating the forms as much as possible in javascript at the
client side.  This reduces the load on the server and the user
experience is enhanced.
For the same reason I am using as much as possible Ajax calls iso a
form submit, to send the prevalidated form fields to the server.
Because the fields are prevalidated, it is very easy storing the
result in a model instance.

All I need are some good pieces of javascript code to do validation
and the Ajax calls.

cheers
Ruben


+1 .. I never understood the usefulness of generating HTML forms with Python code. What I do is that I'm writing the HTML form by hand and for validation I'm also doing a first check in javascript, and on the server-side I'm using a small function to validate the form and I'm using Genshi filters (especially HTMLFormFiller and a Transformer filter). This has some advantages over FormEncode/htmlfill : the template doesn't need to be parsed and serialized again, and my HTML templates (forms) don't contain tests like :

if error:
  <input ... class="error" /> Error message comes here
else:
  <input ... class="error" />
  ...

just my 2 cents :)

Julien

--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

<<attachment: jcigar.vcf>>

Reply via email to