Dalius Dobravolskas wrote:
>> if request.environ.has_key('paste.parsed_formvars'):
>> for item in request.environ['paste.parsed_formvars'][0].items():
>> do_smth(item)
>>
>> Is there a shorter / proper way to do it?
> Learn FormEncode or ToscaWidgets. I use both but like plain FormEncode more.
There are three problems with FormEncode:
1. From what I gather in the docs, it seems FormEncode is directed more
at form value validation rather than form generation. Author plainly
states in the docs that FormEncode has limitations in the area of form
generation:
"At one time FormEncode included form generation in addition to
validation. The form generation worked okay; it was reasonably
attractive, and in many ways quite powerful. I might revisit it. But
generation is limited. It works great at first, then you hit a wall –
you want to make a change, and you just can’t, it doesn’t fit into the
automatic generation."
2. In simple / naive usage mode it requires mixing HTML and code, which
I abhor, on top of it being contrary to the principles of 'separation of
layers' in MVC.
Sure, one could theoretically think about parsing templates and getting
form strings out and then passing them to FormEncode for validation
and/or further generation, or do smth even fancier like storing form
HTML in database and then passing it to FormEncode. But that's
complicated and I'm just a beginner with all the components of Pylons.
Maybe some day.
3. I don't mean to be ungrateful towards Ian or smth, but I find
FormEncode's documentation to be rather limited to tell the truth.
By all means I am willing to expend some effort to learn FormEncode, but
correct me if I'm wrong in thinking that it's mostly useful for user
input validation, not form generation -- which leaves me with the
original dilemma.
Practically speaking, I need to store things like user's SpamAssassin's
settings in db, then set appropriate values / radio buttons / etc in the
form and obviously allow editing & saving those. How would you approach
such a problem in Pylons?
Should I just write the HTML forms in templates manually or what?
Regards,
mk
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---