Exemplo n.º 1
0
 def url(self, request, *args, **kw):
     result = RestController.url(self, request, *args, **kw)
     if not request.extension:
         return result
     if result[-1] == '/':
         return result[:-1] + request.extension  + '/'
     return result + request.extension
Exemplo n.º 2
0
    def url(self, request, *args, **kw):
        result = None
        try:
            result = RestController.url(self, request, *args, **kw)
        except exceptions.KeyError:
            # workaround to be able to return URLs linking to Django
            # which are hard coded string return values from the
            # get_absolute_url function
            return "".join(args)

        if not request.extension:
            return result
        if result[-1] == "/":
            return result[:-1] + request.extension + "/"
        return result + request.extension
Exemplo n.º 3
0
 def __init__(self, cfg, db):
     self.cfg = cfg
     self.db = db
     RestController.__init__(self, None, None, [cfg, db])
Exemplo n.º 4
0
 def __init__(self):
     self.books = {'foo' : Book('foo'), 'bar' : Book('bar')}
     RestController.__init__(self, None, None, [self.books])
Exemplo n.º 5
0
 def __init__(self, parent, path, books):
     self.booklist = books
     RestController.__init__(self, parent, path, [books])
Exemplo n.º 6
0
 def __init__(self, parent, path, cfg, db):
     self.cfg = cfg
     self.db = db
     RestController.__init__(self, parent, path, [cfg, db])