Esempio n. 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)
Esempio n. 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])
Esempio n. 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)
Esempio n. 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])
Esempio n. 5
0
 def linkAsParent(self, request):
     return helpers.link(self.name(request), 
                         helpers.getCrudNode(self), 
                         "view", 
                         [self.obj.id])
Esempio n. 6
0
 def linkAsParent(self, request):
     return helpers.link(self.name(request), 
                         helpers.getCrudNode(self), 
                         "view", 
                         [self.obj.id])