forked from CEN-RA/Plugin_QGIS
lecture des description dans un tooltip
This commit is contained in:
parent
5a03084daa
commit
8c55d902c0
@ -285,16 +285,20 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
if self.comboBox.currentText() == 'toutes les catégories':
|
||||
custom_list = schemaname_list
|
||||
elif self.comboBox.currentText() == 'travaux':
|
||||
custom_list = """(SELECT schemaname,tablename from pg_catalog.pg_tables
|
||||
where schemaname like '""" + str(self.comboBox.currentText()) + """%' order by schemaname,tablename) UNION (SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews where schemaname like '""" + str(self.comboBox.currentText()) + """%' order by schemaname,tablename) order by schemaname,tablename;"""
|
||||
custom_list = schemaname_list[:-2] + """
|
||||
WHERE schemaname LIKE '""" + str(self.comboBox.currentText()) + """%';
|
||||
"""
|
||||
else:
|
||||
custom_list = """(SELECT schemaname,tablename from pg_catalog.pg_tables
|
||||
where schemaname like '\\_""" + str(self.comboBox.currentText()) + """%' order by schemaname,tablename) UNION (SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews where schemaname like '\\_""" + str(self.comboBox.currentText()) + """%' order by schemaname,tablename) order by schemaname,tablename;"""
|
||||
custom_list = schemaname_list[:-2] + """
|
||||
WHERE schemaname LIKE '_""" + str(self.comboBox.currentText()) + """%';
|
||||
"""
|
||||
else:
|
||||
if self.comboBox.currentText() == 'toutes les catégories':
|
||||
custom_list = schemaname_list_ref
|
||||
else:
|
||||
custom_list = """SELECT schemaname, tablename from pg_catalog.pg_tables WHERE schemaname LIKE '""" + str(self.comboBox.currentText()) + """' AND tablename NOT LIKE 'qgis_projects' order by schemaname, tablename;"""
|
||||
custom_list = schemaname_list_ref[:-2] + """
|
||||
WHERE schemaname LIKE '""" + str(self.comboBox.currentText()) + """%' AND tablename NOT LIKE 'qgis_projects';
|
||||
"""
|
||||
cur.execute(custom_list)
|
||||
list_schema = cur.fetchall()
|
||||
|
||||
@ -384,6 +388,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.tableWidget.setColumnCount(5)
|
||||
i = 0
|
||||
for value in list_schema:
|
||||
metadata = value[2]
|
||||
if dbtype == sigdb:
|
||||
type_val = str(value[0])[1:3]
|
||||
schema_name = str(value[0])[4:]
|
||||
@ -448,8 +453,9 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.tableWidget.setCellWidget(i, 4, self.FavButton)
|
||||
|
||||
# Coloration des lignes selon les droits d'accès
|
||||
if (str(value[0]) + '.' + str(value[1])) in GrandUser:
|
||||
pass # L'utilisateur a les droits
|
||||
if (str(value[0]) + '.' + str(value[1])) in GrandUser: # L'utilisateur a les droits
|
||||
for j in range(self.tableWidget.columnCount()):
|
||||
self.tableWidget.item(i, j).setToolTip(metadata)
|
||||
else:
|
||||
# Coloration en violet si droits insuffisants
|
||||
for j in range(self.tableWidget.columnCount()):
|
||||
|
||||
@ -2,13 +2,57 @@
|
||||
schemaname_distinct = """SELECT DISTINCT schemaname from pg_catalog.pg_tables
|
||||
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
|
||||
order by schemaname;"""
|
||||
schemaname_list_ref = """SELECT schemaname,tablename from pg_catalog.pg_tables
|
||||
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
|
||||
order by schemaname,tablename;"""
|
||||
schemaname_list = """(SELECT schemaname,tablename from pg_catalog.pg_tables
|
||||
where schemaname like 'trav%' or schemaname like '\\_ag%' or schemaname like '\\_00%' or schemaname like '\\_01%' or schemaname like '\\_07%' or schemaname like '\\_26%' or schemaname like '\\_form%' or schemaname like '\\_42%' or schemaname like '\\_69%' order by schemaname,tablename)
|
||||
UNION
|
||||
(SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews order by schemaname,tablename) order by schemaname,tablename;"""
|
||||
|
||||
schemaname_list_ref = """
|
||||
WITH TableList AS (SELECT
|
||||
schemaname,
|
||||
tablename
|
||||
FROM pg_catalog.pg_tables
|
||||
WHERE
|
||||
schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
|
||||
ORDER BY schemaname,tablename),
|
||||
TableDescription AS (SELECT
|
||||
schemaname,
|
||||
tablename,
|
||||
description
|
||||
FROM TableList
|
||||
LEFT JOIN pg_description ON objoid = (quote_ident(schemaname)||'.'||quote_ident(tablename))::regclass
|
||||
ORDER BY schemaname, tablename)
|
||||
SELECT * FROM TableDescription;
|
||||
"""
|
||||
|
||||
schemaname_list = """
|
||||
WITH
|
||||
TableList as (SELECT
|
||||
schemaname,
|
||||
tablename
|
||||
FROM pg_catalog.pg_tables
|
||||
WHERE schemaname LIKE 'trav%' OR schemaname LIKE '_ag%' OR schemaname LIKE '_00%' OR schemaname LIKE '_01%' OR schemaname LIKE '_07%' OR schemaname LIKE '_26%' OR schemaname LIKE '_form%' OR schemaname LIKE '_42%' OR schemaname LIKE '_69%'
|
||||
ORDER BY schemaname,tablename),
|
||||
|
||||
ViewList as (SELECT
|
||||
schemaname,
|
||||
matviewname AS tablename
|
||||
FROM pg_catalog.pg_matviews
|
||||
ORDER BY schemaname,tablename),
|
||||
|
||||
TableAndView as (SELECT
|
||||
schemaname,
|
||||
tablename
|
||||
FROM TableList
|
||||
UNION SELECT schemaname,tablename FROM ViewList),
|
||||
|
||||
TableViewDescription as (SELECT
|
||||
schemaname,
|
||||
tablename,
|
||||
description
|
||||
FROM TableAndView
|
||||
LEFT JOIN pg_description ON objoid = (quote_ident(schemaname)||'.'||quote_ident(tablename))::regclass
|
||||
ORDER BY schemaname,tablename)
|
||||
|
||||
SELECT * FROM TableViewDescription;
|
||||
"""
|
||||
|
||||
geom = "geom"
|
||||
champ_travaux_prevus_multipolygon = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
||||
champ_travaux_prevus_multilinestring = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user