Skip to content. | Skip to navigation

Personal tools
You are here: Home Programming Python Adventures in Plone (and Zope) On the debugging of page templates

On the debugging of page templates

... and form controllers and macros and webforms ...

Try embedding something like this in your code:

<dl class="collapsible inline collapsedOnLoad">
   <dt class="collapsibleHeader">Title</dt>
      <dd class="collapsibleContent">
         <span tal:replace="structure python: here.printRequest(request, errors)"/>
      </dd>
</dl>

and supply the necessary printRequest somewhere in your code or as a script:

def printRequest (self, request, errors):
        req = dict(request)
        buf = StringIO()
        buf.write ("<div>")
        buf.write ("<p><b>request:</b></p>")
        buf.write ("<ul>")
        for k, v in req.iteritems():
                buf.write ("<li>%s: %s</li>" % (k, v))
        buf.write ("</ul>")
        buf.write ("<p><b>errors:</b></p>")
        buf.write ("<ul>")
        for k, v in errors.iteritems():
                buf.write ("<li>%s: %s</li>" % (k, v))
        buf.write ("</ul>")
        buf.write ("</div>")
        return buf.getvalue()
Document Actions
Visitors
Locations of visitors to this page
Ads
 
Sections