当前位置: 首页>>代码示例>>Python>>正文


Python Document.fillTree方法代码示例

本文整理汇总了Python中document.Document.fillTree方法的典型用法代码示例。如果您正苦于以下问题:Python Document.fillTree方法的具体用法?Python Document.fillTree怎么用?Python Document.fillTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在document.Document的用法示例。


在下文中一共展示了Document.fillTree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: OwnerNeighbour

# 需要导入模块: from document import Document [as 别名]
# 或者: from document.Document import fillTree [as 别名]
class OwnerNeighbour(QDialog,  Ui_DialogOwnerNeighbour):
    def __init__(self, iface):
        QDialog.__init__(self, iface.mainWindow())
        self.iface = iface
        self.canvas = self.iface.mapCanvas()
        self.setupUi(self)

        self.connect(self.pushButtonSave, SIGNAL("clicked()"), self.saveON)        
        self.connect(self.pushButtonClose, SIGNAL("clicked()"), self.closeDlg)        
        self.connect(self.pushButtonAddDocument, SIGNAL("clicked()"), self.doAddDocument)        
        self.connect(self.pushButtonEditDocument, SIGNAL("clicked()"), self.doEditDocument)        
        self.connect(self.pushButtonDelDocument, SIGNAL("clicked()"), self.doDelDocument)        

        self.dlgDocument = None

        self.guidON = ''
        self.guidPN = ''
        self.action = ''

################################################################################
    def dlgFill(self):
        if self.guidON == '':
            return

        listAttributesON = attributesByKeys('pb_owner_neighbour', 
                                            'guid', [self.guidON], 
                                            attributesNamesOwnerNeighbour)
        if len(listAttributesON) == 1:
            dictAttributesON = listAttributesON[0]

            self.lineEditNameRight.setText(reNull(dictAttributesON['name_right'], ''))
            self.lineEditNameOwner.setText(reNull(dictAttributesON['name_owner'], ''))
            self.lineEditContactAddress.setText(reNull(dictAttributesON['contact_address'], ''))

            self.treeWidget.clear()
            listGuidDocument = attributesByKeys('pb_owner_neighbour_document', 
                                                'guid_owner_neighbour', [self.guidON], 
                                                attributesNamesOwnerNeighbourDoc)

            if len(listGuidDocument) > 0:
                listGuid = [str(every['guid_document']) for every in listGuidDocument]
                listAttributesDocument = attributesByKeys('pb_document', 
                                                          'guid', listGuid, 
                                                          attributesNamesDocument)
                for dictAttributesDocument in listAttributesDocument:
                    guidDocument = str(dictAttributesDocument['guid'])
                    numberDoc = reNull(dictAttributesDocument['number_doc'], '')
                    nameDoc   = reNull(dictAttributesDocument['name'], '')

                    itemForInsert = QTreeWidgetItem([numberDoc, nameDoc])
                    itemForInsert.setData(2, 0, guidDocument)
                    self.treeWidget.addTopLevelItem(itemForInsert)

        
################################################################################
    def saveON(self):
        listNames = ['guid_parcel_neighbour', 'name_right', 'name_owner', 
                     'contact_address']
        listValues = []
        listValues.append(self.guidPN)
        listValues.append(self.lineEditNameRight.text())
        listValues.append(self.lineEditNameOwner.text())
        listValues.append(self.lineEditContactAddress.text())

        if (self.action == 'add') and (len(listNames) == len(listValues)):
            if not insertFeatures('pb_owner_neighbour', listNames, [listValues]):
                QMessageBox.warning(self.iface.mainWindow(), u'Ошибка редактирования данных', 
                                                             u'Произошла ошибка при создании правообладателя смежного ЗУ')

        elif (self.action == 'edit') and (len(listNames) == len(listValues)):
            if not updateFeature('pb_owner_neighbour', self.guidON, 
                                 listNames, listValues):
                QMessageBox.warning(self.iface.mainWindow(), u'Ошибка редактирования данных', 
                                                             u'Произошла ошибка при редактировании правообладателя смежного ЗУ')
        else:
            QMessageBox.warning(self.iface.mainWindow(), u'Ошибка вызова диалога редактирования', 
                                                         u'Не определена цель вызова диалога.')
        self.done(1)

################################################################################
    def doAddDocument(self):
        if self.dlgDocument == None:
            self.dlgDocument = Document(self.iface)
            self.dlgDocument.fillTree()
        
        self.dlgDocument.selectedGuid = None

        self.dlgDocument.exec_()
        if self.dlgDocument.selectedGuid != None:
            if self.guidON == '':
                self.guidON = str(uuid.uuid4())
                listNames  = ['guid', 'guid_parcel_neighbour', 'name_right', 
                              'name_owner', 'contact_address']
                listValues = []
                listValues.append(self.guidON)
                listValues.append(self.guidPN)
                listValues.append(self.lineEditNameRight.text())
                listValues.append(self.lineEditNameOwner.text())
                listValues.append(self.lineEditContactAddress.text())

#.........这里部分代码省略.........
开发者ID:Biryuchkov,项目名称:openLand,代码行数:103,代码来源:ownerneighbour.py

示例2: kn

# 需要导入模块: from document import Document [as 别名]
# 或者: from document.Document import fillTree [as 别名]

#.........这里部分代码省略.........

            if (len(listValues) > 0) and (len(listNames) == len(listValues)):
                if not insertFeatures('pb_kn', listNames, [listValues]):
                    QMessageBox.warning(self.iface.mainWindow(), u'Ошибка редактирования данных', 
                                                                 u'Произошла ошибка при создании кадастрового номера')

        elif self.action == 'edit':
            listNames = []
            listValues = []
            
            if self.tip_kn in (1, 4):
                listNames = ['id_uchastok', 'tip_kn', 'kn']

                listValues.append(self.id_uchastok)
                listValues.append(self.tip_kn)
                listValues.append(self.lineEditKn.text())

            elif self.tip_kn == 2:
                listNames = ['id_uchastok', 'tip_kn', 'kn', 'definition', 'other']
                listValues.append(self.id_uchastok)
                listValues.append(self.tip_kn)
                listValues.append(self.lineEditKn.text())
                listValues.append(self.lineEditDefinition.text())
                listValues.append(self.lineEditOther.text())

            elif self.tip_kn == 3:
                listNames = ['id_uchastok', 'tip_kn', 'kn', 'number']

                listValues.append(self.id_uchastok)
                listValues.append(self.tip_kn)
                listValues.append(self.lineEditKn.text())
                listValues.append(self.lineEditNumber.text())

            if (len(listValues) > 0) and (len(listNames) == len(listValues)):
                if not updateFeature('pb_kn', self.id_kn, listNames, listValues):
                    QMessageBox.warning(self.iface.mainWindow(), u'Ошибка редактирования данных', 
                                                                 u'Произошла ошибка при редактировании кадастрового номера')
        else:
            QMessageBox.warning(self.iface.mainWindow(), u'Ошибка вызова диалога редактирования', 
                                                         u'Не определена цель вызова диалога.')
        self.done(1)

################################################################################
    def doAddDocument(self):
        if self.dlgDocument == None:
            self.dlgDocument = Document(self.iface)
            self.dlgDocument.fillTree()
        
        self.dlgDocument.selectedGuid = None

        self.dlgDocument.exec_()
        if self.dlgDocument.selectedGuid != None:
            listNames = ['id_kn', 'guid_document']
            listValues = [[self.id_kn, self.dlgDocument.guidDocument]]

            if insertFeatures('pb_kn_document', listNames, listValues):
                self.dlgFill()

            else:
                QMessageBox.warning(self.iface.mainWindow(), u'Ошибка', 
                    u'Произошла ошибка добавления документа')
    
################################################################################
    def doEditDocument(self):
        currentTreeItem = self.treeWidget.currentItem()
        if currentTreeItem == None:
            self.pushButtonEditDocument.setEnabled(True)
            self.pushButtonDelDocument.setEnabled(True)
            return

        if self.dlgDocument == None:
            self.dlgDocument = Document(self.iface)
            
        self.dlgDocument.guidDocument = currentTreeItem.data(2, 0)
        self.dlgDocument.fillTree()
        self.dlgDocument.exec_()
        self.dlgFill()

################################################################################
    def doDelDocument(self):
        currentItem = self.treeWidget.currentItem()
        if currentItem != None:
            guidDocument = str(currentItem.data(2, 0))
            if guidDocument > ' ':
                searchCondition = '\"id_kn\" = ' + str(self.id_kn) + ' AND \"guid_document\" = \'' + str(guidDocument) +'\''
                listAttributesSection = attributesBySearchCondition('pb_kn_document', 
                                                                     searchCondition, 
                                                                     ['guid'])
                if len(listAttributesSection) == 1:
                    guidForDelete = str(listAttributesSection[0]['guid'])
                    if deleteById('pb_kn_document', guidForDelete):
                        self.dlgFill()

                    else:
                        QMessageBox.warning(self.iface.mainWindow(), u'Ошибка', 
                                                                     u'Произошла ошибка удаления документа из списка')
                            
################################################################################
    def closeDlg(self):
        self.done(0)
开发者ID:Biryuchkov,项目名称:openLand,代码行数:104,代码来源:kn.py

示例3: address

# 需要导入模块: from document import Document [as 别名]
# 或者: from document.Document import fillTree [as 别名]

#.........这里部分代码省略.........
                                                'pb_stroenie')
        if self.id_stroenie > 0: 
            listNames.append('id_stroenie')
            listValues.append(self.id_stroenie)

        self.id_kvartira = self.checkClassValue(self.comboBoxKvartira, 
                                                self.comboBoxTKvartira, 
                                                'pb_kvartira')
        if self.id_kvartira > 0: 
            listNames.append('id_kvartira')
            listValues.append(self.id_kvartira)

        if self.action == 'add':
            listNames.append('komanda_serveru')
            listValues.append('id_uch=' + str(self.id_uchastok))

            insertFeatures('pb_adres', listNames, [listValues])

        elif self.action == 'edit':
            self.layer.setSubsetString('\"id\"=' + str(self.id))
            updateFeature('pb_adres', self.id, listNames, listValues)

        else:
            QMessageBox.warning(self.iface.mainWindow(), u'Ошибка вызова диалога редактирования адреса', 
                                                         u'Не определена цель вызова диалога')
        self.done(1)

    def createDescription(self):
        if self.textEditOpisanie.toPlainText() < ' ':
            opisanie = reNull(self.comboBoxRegion.currentText(), '')

            listComBox = [[self.comboBoxTRayon,         self.comboBoxRayon],
                          [self.comboBoxTMo,            self.comboBoxMo],
                          [self.comboBoxTGorodRayon,    self.comboBoxGorodRayon],
                          [self.comboBoxTSelsovet,      self.comboBoxSelsovet],
                          [self.comboBoxTNaselenPunkt,  self.comboBoxNaselenPunkt],
                          [self.comboBoxTUlica,         self.comboBoxUlica],
                          [self.comboBoxTDom,           self.comboBoxDom],
                          [self.comboBoxTKorpus,        self.comboBoxKorpus],
                          [self.comboBoxTStroenie,      self.comboBoxStroenie],
                          [self.comboBoxTKvartira,      self.comboBoxKvartira]]

            for every in listComBox:
                row = reNull(every[0].itemData(every[0].currentIndex()), '') 
                row = row + '. ' + reNull(every[1].currentText(), '')
                if row > '. ': 
                    if opisanie > '': 
                        opisanie = opisanie +', '+ row
                    else: 
                        opisanie = row

            if opisanie > '. ': 
                self.textEditOpisanie.setText(opisanie)

    def regionSelect(self, itemIndex):
        self.pushButtonKladr.setEnabled(False)
        if itemIndex >= 0:
            if self.comboBoxRegion.itemData(itemIndex) > '00':
                self.pushButtonKladr.setEnabled(True)
    
    
    def doKladr(self):
        if self.dlgKladr == None:
            self.dlgKladr = Kladr(self.iface)

        self.dlgKladr.idRegion = self.comboBoxRegion.itemData(self.comboBoxRegion.currentIndex())
        self.dlgKladr.fillFirstComboBox()
        self.dlgKladr.exec_()
        if self.dlgKladr.kladr > '':
            self.lineEditKLADR.setText(self.dlgKladr.kladr)
            self.lineEditOKATO.setText(self.dlgKladr.okato)
            self.lineEditIndeks.setText(self.dlgKladr.index)
            self.comboBoxTRayon.setFocus()
    
    def doDocument(self):
        if self.dlgDocument == None:
            self.dlgDocument = Document(self.iface)
            self.dlgDocument.fillTree()
        
        self.dlgDocument.selectedGuid = None

        self.dlgDocument.exec_()
        if self.dlgDocument.selectedGuid != None:

            self.comboBoxDocument.clear()
            self.comboBoxDocument.addItem(u' ', None)

            if self.dlgDocument.selectedGuid > ' ':
                attributesDocument = attributesByKeys('pb_document', 
                                                      'guid', 
                                                      [str(self.dlgDocument.selectedGuid)], 
                                                      attributesNamesDocument)
                if len(attributesDocument) == 1:
                    attributesDocument = attributesDocument[0]
                    title = attributesDocument['number_doc'] + ' ' + attributesDocument['date'].toString('yyyy-MM-dd') + ' ' + attributesDocument['name'][:33]
                    self.comboBoxDocument.addItem(unicode(title), str(self.dlgDocument.selectedGuid))
                    self.comboBoxDocument.setCurrentIndex(1)
    
    def close(self):
        self.done(0)
开发者ID:Biryuchkov,项目名称:openLand,代码行数:104,代码来源:address.py


注:本文中的document.Document.fillTree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。