If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    kmouts  13 years ago
    My small contributions: 1. In CONTROLLER
    
    def maker():
        makers = db(db.Maker.Category_ID==request.vars.category_name).select(db.Maker.ALL)
        opts=[OPTION(maker.Name,_value=str(maker.id)) for maker in makers]
        s = SELECT(opts,_name='maker_name')
        s[1].update(_selected="_selected")
        result = s.xml()
        return XML(result)
    
    This way the select tag is constructed in a more "web2pythonic" way IMHO. In addition, the
    "selected" option is easy to be chosen in the initial form. Otherwise the "for" loop must be broken,
    to add an

Commented on:

Thank you Juan Funez for the idea. https://groups.google.com/group/web2py/browse_thread/thread/1bed807214ecaab5#

Hosting graciously provided by:
Python Anywhere