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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2009-07-05 07:54:29 UTC
  • mto: (1294.4.2 ui-the-third)
  • mto: This revision was merged to the branch mainline in revision 1353.
  • Revision ID: grantw@unimelb.edu.au-20090705075429-qyh9midyp0v73gnv
Add export details for the breadcrumb chevron SVG.

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
30
29
from ivle.webapp.errors import BadRequest, MethodNotAllowed, Unauthorized
31
30
 
32
31
class RESTView(BaseView):
56
55
        if not hasattr(op, '_rest_api_permission'):
57
56
            raise Unauthorized()
58
57
 
59
 
        if (op._rest_api_permission not in
60
 
            self.get_permissions(req.user, req.config)):
 
58
        if op._rest_api_permission not in self.get_permissions(req.user):
61
59
            raise Unauthorized()
62
60
    
63
61
    def convert_bool(self, value):
150
148
            req.write("\n")
151
149
 
152
150
 
153
 
class XHTMLRESTView(GenshiLoaderMixin, JSONRESTView):
 
151
class XHTMLRESTView(JSONRESTView):
154
152
    """A special type of RESTView which takes enhances the standard JSON
155
153
    with genshi XHTML functions.
156
154
    
165
163
 
166
164
        rest_template = os.path.join(os.path.dirname(
167
165
                inspect.getmodule(self).__file__), self.template)
168
 
        tmpl = self._loader.load(rest_template)
 
166
        loader = genshi.template.TemplateLoader(".", auto_reload=True)
 
167
        tmpl = loader.load(rest_template)
169
168
 
170
169
        return tmpl.generate(self.ctx).render('xhtml', doctype='xhtml')
171
170