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