コード例 #1
0
ファイル: addtable.py プロジェクト: Guillon88/stdm
 def tableCapabilities(self):
     options=['create', 'select', 'update', 'delete']
     capabilities={}
     for opt in options:
         capabilities['name'] = opt
         capabilities['code'] = setUniversalCode()
         writeTableColumn(capabilities, self.profile, 'table', self.table, 'contentgroups')
コード例 #2
0
ファイル: addtable.py プロジェクト: Guillon88/stdm
 def dataColumnForLookup(self,Node):
     attrib  = {
         'name' : 'value',
         'fullname' : 'Choice list',
         'type' : 'character varying',
         'size' : '50'
          }
     writeTableColumn(attrib,self.profile,Node,self.table,'columns')
コード例 #3
0
ファイル: attribute_editor.py プロジェクト: 7o9/stdm-plugin
 def enforceProjection(self):
     if self.geomCollection:
         geom={}
         geom['table'] = self.tableName
         geom['srid'] = self.geomCollection[0]
         geom['column'] = formatColumnName(self.txtCol.text())
         geom['type'] = self.geomCollection[1]
         geom['arguments'] = '2'
         writeTableColumn(geom,self.profile,'table',self.tableName,'constraints')
コード例 #4
0
 def enforceProjection(self):
     if self.geomCollection:
         geom = {}
         geom["table"] = self.tableName
         geom["srid"] = self.geomCollection[0]
         geom["column"] = formatColumnName(self.txtCol.text())
         geom["type"] = self.geomCollection[1]
         geom["arguments"] = "2"
         writeTableColumn(geom, self.profile, "table", self.tableName, "geometryz")
コード例 #5
0
ファイル: attribute_editor.py プロジェクト: 7o9/stdm-plugin
 def setTableRelation(self):
     '''add new relation to the table in the config file'''
     attribDict={}
     
     attribDict['name']=formatColumnName(self.txtCol.text())+"_id"
     attribDict['table']=self.lookup
     attribDict['column']="id"
     attribDict['ondelete']="NO ACTION"
     attribDict['onupdate']="NO ACTION"
     writeTableColumn(attribDict,self.profile,'table',self.tableName,'relations')            
コード例 #6
0
ファイル: addtable.py プロジェクト: 7o9/stdm-plugin
 def autoCreatePrimaryKeyColumn(self,Node):
     """Allow automatic created of primary column in the table"""
     attrib = {
         'name' : 'id',
         'fullname' : 'Primary Key',
         'type' : 'serial',
         'size' : '',
         'key' : '1'
     }
     writeTableColumn(attrib,self.profile,Node,self.table,'columns')
コード例 #7
0
    def setTableRelation(self):
        """add new relation to the table in the config file"""
        attribDict = {}

        attribDict["name"] = formatColumnName(self.txtCol.text()) + "_id"
        attribDict["table"] = self.lookup
        attribDict["column"] = "id"
        attribDict["ondelete"] = "NO ACTION"
        attribDict["onupdate"] = "NO ACTION"
        writeTableColumn(attribDict, self.profile, "table", self.tableName, "relations")
コード例 #8
0
ファイル: table_propertyDlg.py プロジェクト: 7o9/stdm-plugin
 def setTableRelation(self):
     '''add new relation to the table in the config file'''
     delAct=UserData(self.cboDelAct)
     updateAct=UserData(self.cboUpAct)
     attribDict={}
     attribDict['name']=formatColumnName(self.txtName.text())
     attribDict['table']=self.cboTable.currentText()
     attribDict['fk']=self.cboRefCol.currentText()
     attribDict['column']=self.cboColumn.currentText()
     attribDict['ondelete']=delAct
     attribDict['onupdate']=updateAct
     writeTableColumn(attribDict,self.userProfile,'table',self.tableName,'relations')
コード例 #9
0
ファイル: addtable.py プロジェクト: Guillon88/stdm
 def autoCreatePrimaryKeyColumn(self,Node):
     """Allow automatic created of primary column in the table"""
     attrib = {
         'name' : 'id',
         'fullname' : 'Primary Key',
         'type' : 'serial',
         'size' : '',
         'key' : '1'
     }
     if table_column_exist(self.profile, self.table, 'id'):
         return
         QMessageBox.information(self, "ID exist", "Id exisit")
     else:
         writeTableColumn(attrib,self.profile,Node,self.table,'columns')
コード例 #10
0
ファイル: attribute_editor.py プロジェクト: 7o9/stdm-plugin
 def writeAttributeData(self):
     #Flush the new attribute data to the xml file
     atType=UserData(self.cboDatatype)
     if atType not in self.defaults and self.txtAttrib.text()=="":
         self.ErrorInfoMessage(QApplication.translate("AttributeEditor","Attribute length is not given"))
         return
     if self.txtCol.text()=="":
         self.ErrorInfoMessage(QApplication.translate("AttributeEditor","Column name is not given"))
         return
     if atType in self.defaults:
         sizeval=''
     if atType not in self.defaults:
         sizeval=self.txtAttrib.text()
     attribData=self.attributeData(sizeval)
     self.tableName=self.cboTabList.currentText()
     if str(self.tableName).startswith("check"):
         writeTableColumn(attribData,self.profile,'lookup',self.tableName,'columns')
     else:
         if atType=='geometry':
             self.InfoMessage(QApplication.translate("AttributeEditor","Geometry column will not appear in the list of column but it is loaded in the background"))
             self.enforceProjection()
         else:
             writeTableColumn(attribData,self.profile,'table',self.tableName,'columns')
コード例 #11
0
    def writeAttributeData(self):
        # Flush the new attribute data to the xml file

        atType = UserData(self.cboDatatype)
        if atType in self.defaults:
            sizeval = ""
        if atType not in self.defaults:
            sizeval = self.txtAttrib.text()
        attribData = self.attributeData(sizeval)
        self.tableName = self.cboTabList.currentText()
        if str(self.tableName).startswith("check"):
            writeTableColumn(attribData, self.profile, "lookup", self.tableName, "columns")
        else:
            if atType == "geometry":
                self.InfoMessage(
                    QApplication.translate(
                        "AttributeEditor",
                        "Geometry column will not appear in the list of column but can be viewed under geometry tab",
                    )
                )
                self.geomtag()
                self.enforceProjection()
            else:
                writeTableColumn(attribData, self.profile, "table", self.tableName, "columns")