def manage_addGraphDefinition(self, new_id, REQUEST=None): """Add a GraphDefinition """ from GraphDefinition import GraphDefinition graph = GraphDefinition(new_id) graph.sequence = len(self.graphDefs()) self.graphDefs._setObject(graph.id, graph) graph = self.graphDefs._getOb(graph.id) if REQUEST: audit('UI.Report.AddGraphDefinition', self.id, graphDefinition=graph.id) url = '%s/graphDefs/%s' % (self.getPrimaryUrlPath(), graph.id) return REQUEST['RESPONSE'].redirect(url) return graph
def manage_addGraphDefinition(self, new_id, REQUEST=None): """Add a GraphDefinition to our RRDTemplate. """ from GraphDefinition import GraphDefinition self.getGraphDefs() graph = None graph = GraphDefinition(new_id) graph.sequence = len(self.graphDefs()) self.graphDefs._setObject(graph.id, graph) graph = self.graphDefs._getOb(graph.id) if REQUEST: messaging.IMessageSender(self).sendToBrowser( 'Graph Added', 'Graph "%s" added' % graph.id) url = '%s/graphDefs/%s' % (self.getPrimaryUrlPath(), graph.id) return REQUEST['RESPONSE'].redirect(url) return graph
def manage_addGraphDefinition(self, new_id, REQUEST=None): """Add a GraphDefinition to our RRDTemplate. """ from GraphDefinition import GraphDefinition self.getGraphDefs() graph = None graph = GraphDefinition(new_id) graph.sequence = len(self.graphDefs()) self.graphDefs._setObject(graph.id, graph) graph = self.graphDefs._getOb(graph.id) if REQUEST: messaging.IMessageSender(self).sendToBrowser( 'Graph Added', 'Graph "%s" added' % graph.id ) url = '%s/graphDefs/%s' % (self.getPrimaryUrlPath(), graph.id) return REQUEST['RESPONSE'].redirect(url) return graph