def findData(self, query={}): db = str(self.dbs[self.databaseDropdown.currentIndex()]) collection = str(self.collectionDropdown.currentText()) result = backend.find(db, collection, query) formattedResult = '' for item in result['message']: formattedResult += dumps(item).replace('{', '{\n').replace('}', '}\n').replace(',', ',\n') formattedResult += '\n\n\n' self.resultsArea.setText(formattedResult)
def readUsers(self): users = backend.find('_config', '_users', {})['message'] for user in users: listItem = QListWidgetItem(user['user']) self.UserList.addItem(listItem)