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

Re: [Cheetahtemplate-discuss] Webware placeholders and the searchList

Expand Messages
  • Brian Bird
    I think this might be the same problem I found when I upgraded a while ago:
    Message 1 of 2 , May 23, 2013
    • 0 Attachment

      I think this might be the same problem I found when I upgraded a while ago:

      http://sourceforge.net/mailarchive/forum.php?thread_name=6F7F60AEAD1E0D4B9958C3B7E7D2D4E31EDA82%40STExchange01.Menai.local&forum_name=cheetahtemplate-discuss

       

      Since 2.0 Cheetah seems to look at the Template instance variables before searching the namespace. Most of these variables are prefixed with __CHEETAH__ so it’s unlikely to be an issue. But 4 of them (request, transaction, application and session) aren’t and therefore mask the value you have in your namespace.
      Like you, I don’t use WebWare, but the only solution I found was to rename my variables (eg. in your case call it $session2 instead of $session)
        
      I have no idea why this changed, personally I think it’s a bug but I don’t know if anyone else agrees or whether anyone is maintaining Cheetah any more in any case?
        

       

      From: Aaron Murray [mailto:aaron@...]
      Sent: 22 May 2013 23:54
      To: cheetahtemplate-discuss@...
      Subject: [Cheetahtemplate-discuss] Webware placeholders and the searchList

       

      I am upgrading to Cheetah 2.4.4. I'm getting a lot of errors relating to my $session placeholder (which is added to the searchList via a custom context object as ctx.session).

       

      After the upgrade, $session is always None.  It seems like the Webware session variable from Servlet.py is sitting in the searchList above my custom placeholder.  The current Cheetah docs state:

       

      "However, it is OK to put same-name variables in the searchList, because Webware does not use the searchList."

       

      I know the docs are currently out of date.  It seems like this is no longer true.

       

      Is there any way I can avoid changing the name of my session placeholder in every template?  I do not use Webware so I don't need any related functionality.

       

      Thanks,

      Aaron

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