예제 #1
0
    def __init__(self, config, treeview, parent=None):
        from stdm.data import (
            foreign_key_parent_tables,
            numeric_varchar_columns,
            spatial_tables
        )

        super(EntityNodeFormatter, self).__init__(config, treeview, parent)

        self._str_ref = "social_tenure_relationship"
        self._str_title = QApplication.translate("STRFormatterBase",
                                                 "Social Tenure Relationship")

        self._str_model = DeclareMapping.instance().tableMapping(self._str_ref)

        '''
        Set STR display mapping due to a bug in the 'displayMapping'
        function
        '''
        self._str_model_disp_mapping = {}
        if not self._str_model is None:
            self._str_model_disp_mapping = self._str_model.displayMapping()

        self._str_num_char_cols = numeric_varchar_columns(self._str_ref)
        self._fk_references = foreign_key_parent_tables(self._str_ref)
        self._current_data_source_fk_ref = self._current_data_source_foreign_key_reference()
        self._numeric_char_cols = numeric_varchar_columns(config.data_source_name)
        self._spatial_data_sources = spatial_tables()
예제 #2
0
    def db_tables(self):
        """
        Returns both textual and spatial table names.
        """
        tables = pg_tables(exclude_lookups=False)
        tables.extend(spatial_tables(exclude_views=True))

        return tables
예제 #3
0
 def loadTables(self,type):
     #Load textual or spatial tables
     self.lstDestTables.clear()
     
     if type=="textual":
         tables = pg_tables(excludeLookups=False)
         
     elif type=="spatial":
         tables = spatial_tables(excludeViews=True)
                             
     for t in tables:            
         tabItem = QListWidgetItem(t,self.lstDestTables)
         tabItem.setCheckState(Qt.Unchecked)
         tabItem.setIcon(QIcon(":/plugins/stdm/images/icons/table.png"))
         self.lstDestTables.addItem(tabItem)