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

[Cheetahtemplate-discuss] Manipulating HTML tag attributes

Expand Messages
  • Analog Kid
    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
    Message 1 of 1 , 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>
        ...................
      ...snip

      I call this template from the py file like this:

      #!/usr/local/bin/python
      from cgi import parse
      from Cheetah.Template import Template

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


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

      TIA,
      Ajay

    Your message has been successfully submitted and would be delivered to recipients shortly.