def api_save_groups(self,data): repo = DataRepo(self.dbpath) data = json.loads(data) repo.save_groups(data) jsonData = {} jsonData['success'] = True jsonData['msg'] = 'Groups were saved' return json.dumps(jsonData)
def showGroupDetails(self, groupID): repo = DataRepo(self.dbpath) scripts = "<script type='text/javascript' src='/html/js/showGroupDetails.js'></script>" scripts += "<script type='text/javascript' src='/html/js/jquery.slidePicker.min.js'></script>" html = self._header(scripts) html += "<h2> Details for " + repo.get_group_details(groupID)[0][1] + " group" html += open(os.path.join(os.curdir,'html','pages','showGroupDetails.html'),'r').read() html += self._footer() return html
def api_get_groups(self): repo = DataRepo(self.dbpath) data = repo.get_groups() return json.dumps(data)
def api_get_currentLoad(self): repo = DataRepo(self.dbpath) data = repo.get_current_load() return json.dumps(data)
def api_get_groupData_span(self,id, start, stop): repo = DataRepo(self.dbpath) history = repo.get_group_history_span(id, start, stop) return json.dumps(history)
def api_get_groupData(self, id): repo = DataRepo(self.dbpath) history = repo.get_group_history(id) return json.dumps(history)
def api_delete_group(self,id): repo = DataRepo(self.dbpath) repo.delete_group(id) return json.dumps({"success":True})