~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/base/rest.py

  • Committer: Matt Giuca
  • Date: 2010-02-25 06:52:48 UTC
  • mto: This revision was merged to the branch mainline in revision 1731.
  • Revision ID: matt.giuca@gmail.com-20100225065248-p1t8oys3olxtwdlg
project-form no longer assumes the type of context; pass an extra projectset value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import genshi.template
27
27
 
28
28
from ivle.webapp.base.views import BaseView
 
29
from ivle.webapp.base.xhtml import GenshiLoaderMixin
29
30
from ivle.webapp.errors import BadRequest, MethodNotAllowed, Unauthorized
30
31
 
31
32
class RESTView(BaseView):
149
150
            req.write("\n")
150
151
 
151
152
 
152
 
class XHTMLRESTView(JSONRESTView):
 
153
class XHTMLRESTView(GenshiLoaderMixin, JSONRESTView):
153
154
    """A special type of RESTView which takes enhances the standard JSON
154
155
    with genshi XHTML functions.
155
156
    
164
165
 
165
166
        rest_template = os.path.join(os.path.dirname(
166
167
                inspect.getmodule(self).__file__), self.template)
167
 
        loader = genshi.template.TemplateLoader(".", auto_reload=True)
168
 
        tmpl = loader.load(rest_template)
 
168
        tmpl = self._loader.load(rest_template)
169
169
 
170
170
        return tmpl.generate(self.ctx).render('xhtml', doctype='xhtml')
171
171