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

813[Cheetahtemplate-discuss] Namemapper bug for key starting with 'times'

Expand Messages
  • Hamish Lawson
    Mar 6, 2002
    • 0 Attachment
      I think I've found a bug in Namemapper as demonstrated in the test program

      from Cheetah.Template import Template

      template_source = """\
      #for $timesheet in $timesheets
      #end for

      timesheets = [
      {'week': 46},
      {'week': 47},
      {'week': 48},
      {'week': 49},

      t = Template(source=template_source, searchList=[{'timesheets':
      print t.respond()

      This gives rise to the following error about not finding 'heets'. It looks
      like it does not like the fact that the 'timesheets' key starts with

      Traceback (most recent call last):
      File "E:\temp\test_cheetah\script.py", line 17, in ?
      print t.respond()
      File "<string>", line 25, in respond
      File "E:\Python22\Lib\site-packages\Cheetah\NameMapper.py", line 217, in
      return _valueForName(obj, nameChunks, executeCallables=executeCallables)
      File "E:\Python22\Lib\site-packages\Cheetah\NameMapper.py", line 228, in
      binding = valueForKey(obj, firstKey)
      File "E:\Python22\Lib\site-packages\Cheetah\NameMapper.py", line 203, in
      raise NotFound, key
      Cheetah.NameMapper.NotFound: heets

      Hamish Lawson

      Cheetahtemplate-discuss mailing list
    • Show all 4 messages in this topic