Пример #1
0
    def renderLocalTemplate(self, request, filename):

        # Get a path to the local template relative to
        # something in Mako's templateLookup dirs.
        localNode = helpers.getCrudNode(self.crudModel).__file__
        relPath = os.path.relpath(
            os.path.dirname(localNode),
            os.path.abspath("templates"))
        templatePath = "/%s/%s" % (relPath, filename)

        return self.renderTemplate(request, templatePath)
Пример #2
0
    def render_view(self, request):
        obj = getattr(self.obj, self.col)

        if obj is None:
            return ""

        crud = getCrudObj(obj)

        node = getCrudNode(crud)

        return link(crud.name(request), node, "view", [obj.id])
Пример #3
0
    def renderLocalTemplate(self, request, filename):

        # Get a path to the local template relative to
        # something in Mako's templateLookup dirs.
        localNode = helpers.getCrudNode(self.crudModel).__file__
        relPath = os.path.relpath(
            os.path.dirname(localNode),
            os.path.abspath("templates"))
        templatePath = "/%s/%s" % (relPath, filename)

        return self.renderTemplate(request, templatePath)
Пример #4
0
    def render_view(self, request):
        obj = getattr(self.obj, self.col)

        if obj is None:
            return ""

        crud = getCrudObj(obj)

        node = getCrudNode(crud)

        return link(crud.name(request), node, "view", [obj.id])
Пример #5
0
 def linkAsParent(self, request):
     return helpers.link(self.name(request), 
                         helpers.getCrudNode(self), 
                         "view", 
                         [self.obj.id])
Пример #6
0
 def linkAsParent(self, request):
     return helpers.link(self.name(request), 
                         helpers.getCrudNode(self), 
                         "view", 
                         [self.obj.id])