mk wrote:
> Dalius Dobravolskas wrote:
>>> 2. In simple / naive usage mode it requires mixing HTML and code, which
>> That's not the case. Not sure there you get that from.
>
> Oops, I wasn't clear on this issue: formencode.htmlfill does provide
> some basic form manipulation, but in the form I don't like very much,
> example from docs:
>
> >>> from formencode import htmlfill
> >>> form = '<input type="text" name="fname">'
> >>> defaults = {'fname': 'Joe'}
> >>> htmlfill.render(form, defaults)
> '<input type="text" name="fname" value="Joe">'
>
> Unless values of 'form' and 'defaults' vars are acquired from a place
> different than controller code (from template? database?), this is
> mixing view and controller. That's what I meant to mean.
This is mixing form-values-coming-in with form-values-coming-out. They
are symmetric. Your controller is the place you should handle both of
those values. Of course the form itself should come from a template, it
just doesn't in that example -- you should render a form template, then
fill it with htmlfill.
--
Ian Bicking : [email protected] : http://blog.ianbicking.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---