Functionally you can achieve the same, as you know, with

FORM(
    DIV(
        INPUT(_type='submit') ,
        _class='test'),
    _action='',_method='post')

Syntactically I do not think it is possible to implement the syntax
you suggest because there is no "with" in Python.

Massimo


On Jul 13, 11:12 am, "mr.freeze" <nat...@freezable.com> wrote:
> I'm a .net developer by trade.  I embed IronPython into a lot of my
> apps.  One nice thing I can do with it is build XML using the 'with'
> statement.http://langexplr.blogspot.com/2009/02/writing-xml-with-ironpython-xml...
>
> How hard would this be to implement a similar context protocol for
> web2py's HTML helpers?  This is what I am picturing:
>
> with FORM(_action='',_method='post'):
>     with DIV(_class='test'):
>         INPUT(_type='submit')
>
> Would produce this:
>
> <form enctype="multipart/form-data" action="" method="post">
>   <div class="test">
>     <input type="submit" />
>   </div>
> </form>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to