def update(self): global event event = True form_name = str(self.lineEdit_2.text()) if form_name == 'Coligado': content = urlRequest.list_related() for iterate in content: if iterate['name'] == current: self.name.setText(iterate['name']) self.path.setText(iterate['path']) self.initials.setText(iterate['initials']) if iterate['description'] and iterate['description'] != []: self.description.setText(iterate['description']) elif form_name == 'Curso': content = urlRequest.get_courses(current) for iterate in content: if iterate['name'] == current: self.name.setText(iterate['name']) self.path.setText(iterate['path']) if iterate['workload'] and iterate['workload'] != []: self.workload.setText(str(iterate['workload'])) if iterate['description'] and iterate['description'] != []: self.description.setText(iterate['description']) elif form_name == 'Disciplina': content = urlRequest.get_spaces(course_current) for iterate in content: if iterate['name'] == current: self.name.setText(iterate['name']) if iterate['description'] and iterate['description'] != []: self.description.setText(iterate['description'])
def discipline_related(self): self.clean_form() if self.checkBox_form.checkState() == 0: self.checkBox_form.animateClick() self.lineEdit_2.setText('Disciplina') if self.checkBox_name.checkState() == 0: self.checkBox_name.animateClick() if self.checkBox_path.checkState() == 2: self.checkBox_path.animateClick() if self.checkBox_initials.checkState() == 2: self.checkBox_initials.animateClick() if self.checkBox_workload.checkState() == 2: self.checkBox_workload.animateClick() if self.checkBox_description.checkState() == 0: self.checkBox_description.animateClick() if current: discipline = urlRequest.get_spaces(course_current) if discipline != []: for iterate in discipline: self.comboBox.addItem(iterate['name']) self.listWidget.addItem(iterate['name']) else: self.listWidget.addItem('Nao ha disciplinas cadastradas') self.comboBox.activated[str].connect(self.onActivated_discipline)