+ # you may redefine this completely, but if you don't we'll just use method
+ # template() to find out which template to use, and env() to find out which
+ # dictionary to pass the templating system
+ def render_content (self, request):
+ """Should return an HTML fragment"""
+ template = self.template()
+ env=self.render_env(request)
+ if not isinstance (env,dict):
+ raise Exception, "%s.render_env returns wrong type"%self.classname()
+ env.update(self._settings)
+ result=render_to_string (template, env)
+ print "%s.render_content: BEG --------------------"%self.classname()
+ print "env=%s"%env.keys()
+ print result
+ print "%s.render_content: END --------------------"%self.classname()
+ return result
+
+ def render_env (self, request): return {}
+ ######################################## abstract interface
+
+ # your plugin is expected to implement either
+ # (*) def render_content(self, request) -> html fragment
+ # -- or --
+ # (*) def template(self) -> filename
+ # (*) def render_env (self, request) -> dict
+ # this is the variable->value association used to render the template
+ # in which case the html template will be used
+
+ def title (self): return "you should redefine title()"
+
+ # tell the framework about requirements in the document header
+ def media_js (self): pass