Esempio n. 1
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.setupUi(self)

        self.cboDataSource.setInsertPolicy(QComboBox.InsertAlphabetically)
        self.cboReferencedTable.setInsertPolicy(QComboBox.InsertAlphabetically)
        self.curr_profile = current_profile()
        self.rbTables.toggled.connect(self.onShowTables)
        self.rbViews.toggled.connect(self.onShowViews)

        # Load reference tables
        self._ref_tables = profile_entities(self.curr_profile)

        # Load all tables
        self._tables = profile_user_tables(self.curr_profile, False)
        # Populate referenced tables
        self._populate_referenced_tables()

        # Flag for synchronizing data source item change to referenced table
        self._sync_data_source = False

        # Force views to be loaded
        self.rbViews.toggle()

        # Connect signal
        self.cboDataSource.currentIndexChanged[str].connect(
            self.onDataSourceSelected)

        self.cboReferencedTable.setEnabled(False)
Esempio n. 2
0
    def _load_entity_configurations(self):
        """
        Uses tables' information in the current profile to create the
        corresponding EntityConfig objects.
        """
        try:
            entities = profile_entities(self.curr_profile)
            self._report_gen_dlg.progress.setRange(0, len(entities) - 1)

            for i, t in enumerate(entities):
                QApplication.processEvents()
                # TODO modify these to select table based on context/documents
                if t.name != 'cb_plot':
                    continue
                # Exclude custom tenure entities
                if 'check' in t.name:
                    continue
                entity_cfg = self._entity_config_from_profile(
                    str(t.name), t.short_name)

                if entity_cfg is not None:
                    self._report_gen_dlg.add_entity_config(entity_cfg, i)
            self._report_gen_dlg.progress.hide()
        except Exception as pe:
            self._notif_bar.clear()
            self._notif_bar.insertErrorNotification(pe.message)
Esempio n. 3
0
    def _load_entity_configurations(self):
        """
        Uses tables' information in the current profile to create the
        corresponding EntityConfig objects.
        """
        try:
            for t in profile_entities(self.curr_profile):
                entity_cfg = self._entity_config_from_profile(
                    str(t.name), t.short_name)

                if entity_cfg is not None:
                    self._doc_gen_dlg.add_entity_config(entity_cfg)

        except Exception as pe:
            self._notif_bar.clear()
            self._notif_bar.insertErrorNotification(pe.message)
Esempio n. 4
0
    def _load_entity_configurations(self):
        """
        Uses tables' information in the current profile to create the
        corresponding EntityConfig objects.
        """
        try:
            entities = profile_entities(self.curr_profile)
            self._doc_gen_dlg.progress.setRange(0, len(entities) - 1)

            for i, t in enumerate(entities):
                QApplication.processEvents()
                entity_cfg = self._entity_config_from_profile(
                    str(t.name), t.short_name)

                if entity_cfg is not None:
                    self._doc_gen_dlg.add_entity_config(entity_cfg, i)
            self._doc_gen_dlg.progress.hide()
        except Exception as pe:
            self._notif_bar.clear()
            self._notif_bar.insertErrorNotification(pe.message)
Esempio n. 5
0
    def _load_entity_configurations(self):
        """
        Uses tables' information in the current profile to create the
        corresponding EntityConfig objects.
        """
        try:
            entities = profile_entities(self.curr_profile)
            self._doc_gen_dlg.progress.setRange(0, len(entities) - 1)

            for i, t in enumerate(entities):
                QApplication.processEvents()
                # Exclude custom tenure entities
                if 'check' in t.name:
                    continue
                entity_cfg = self._entity_config_from_profile(
                    str(t.name), t.short_name
                )

                if entity_cfg is not None:
                    self._doc_gen_dlg.add_entity_config(entity_cfg, i)
            self._doc_gen_dlg.progress.hide()
        except Exception as pe:
            self._notif_bar.clear()
            self._notif_bar.insertErrorNotification(pe.message)