Loading ...
Sorry, an error occurred while loading the content.

5005[Cheetahtemplate-discuss] Manipulating HTML tag attributes

Expand Messages
  • Analog Kid
    Jan 8, 2013
    • 0 Attachment
      Hi All:

      Im a noob to Cheetah. I had a question: I have a .py file which uses a .tmpl template file to render some html. In the template, I need to manipulate an HTML tag attribute. Something like this:
      ... snip
      <select name=category value=req.category>
        <option value="cars">Cars</option>

      I call this template from the py file like this:

      from cgi import parse
      from Cheetah.Template import Template

      print "Content-Type: text/html\n"
      print Template(file="somepage.tmpl", searchList = [{'req': req}])

      This doesnt seem to work. Am I passing parameters correctly. What am I missing?