title: Trouble repeating elements using TAL, Chameleon and Pyramid
body: <p>I'm really struggling to get TAL and Chameleon/Pyramid to play nice. . . </p>
  
  <p>I have a view in Pyramid that returns, for example, the following:</p>
  
  <pre><code>def view(request):
      return {'results' : [ {'name':'alice', 'value':22}, 
                            {'name':'bob', 'value':11},
                            {'name':'charlie', 'value':33} ] }
  </code></pre>
  
  <p>I have a template that contains the following bit of HTML:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;td&gt;Keyword&lt;/td&gt;
              &lt;td class="center"&gt;Mean Position&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr tal:repeat"row results"&gt;
              &lt;td&gt;${row.name}&lt;/td&gt;
              &lt;td&gt;${row.value}&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm hoping for HTML output of the following:</p>
  
  <pre><code>&lt;table&gt;
      &lt;thead&gt;
      &lt;tr class="odd"&gt;
          &lt;td&gt;Name&lt;/td&gt;
          &lt;td class="centre"&gt;Age&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;alice&lt;/td&gt;
              &lt;td&gt;22&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;bob&lt;/td&gt;
              &lt;td&gt;11&lt;/td&gt;
          &lt;/tr&gt;            
          &lt;tr&gt;
              &lt;td&gt;charlie&lt;/td&gt;
              &lt;td&gt;33&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>However, Pyramid throws an error when I try to run this:</p>
  
  <pre><code>raise ParseError("Unexpected end tag.", token)
  ParseError: Unexpected end tag.
  - String:   "&lt;/tr&gt;"
  </code></pre>
  
  <p>which I thought was rather weird. I removed the closing <code>&lt;\tr&gt;</code>, and then get the following error:</p>
  
  <pre><code>NameError: row
  - Expression: "python:row['name']"
  </code></pre>
  
  <p>I'm really stuck on this and any help would be appreciated!</p>