[CG] : fix etude
This commit is contained in:
parent
2090c073f6
commit
d038d4c1a1
@ -145,22 +145,30 @@ def get_obs_serena(insicen:bool=None):
|
|||||||
.dropna(axis=1,how='all')
|
.dropna(axis=1,how='all')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def refresh_vm():
|
def refresh_vm():
|
||||||
|
'''Rafraichissement de la vue materialisée vm_synthese_observations'''
|
||||||
sql = "REFRESH MATERIALIZED VIEW saisie.vm_synthese_observations WITH DATA;"
|
sql = "REFRESH MATERIALIZED VIEW saisie.vm_synthese_observations WITH DATA;"
|
||||||
with con_sicen.begin() as cnx:
|
with con_sicen.begin() as cnx:
|
||||||
cnx.execute(sql)
|
cnx.execute(sql)
|
||||||
|
|
||||||
def etude():
|
|
||||||
|
def etude(with_data:bool=True):
|
||||||
|
'''Liste les études associées ou non à de la données'''
|
||||||
from pandas import read_sql_query
|
from pandas import read_sql_query
|
||||||
sql = 'SELECT * FROM md.etude'
|
sql = 'SELECT e.* FROM md.etude e WHERE e.id_etude'
|
||||||
|
if with_data is True : sql += ' IN '
|
||||||
|
else : sql += ' NOT IN '
|
||||||
|
|
||||||
|
sql += '(SELECT id_etude FROM saisie.saisie_observation)'
|
||||||
return read_sql_query(sql, con_sicen)
|
return read_sql_query(sql, con_sicen)
|
||||||
|
|
||||||
|
|
||||||
def lot():
|
def lot():
|
||||||
from pandas import read_sql_query
|
from pandas import read_sql_query
|
||||||
sql = 'SELECT * FROM md.lot'
|
sql = 'SELECT * FROM md.lot'
|
||||||
return read_sql_query(sql, con_sicen)
|
return read_sql_query(sql, con_sicen)
|
||||||
|
|
||||||
|
|
||||||
def protocole():
|
def protocole():
|
||||||
from pandas import read_sql_query
|
from pandas import read_sql_query
|
||||||
sql = 'SELECT * FROM md.protocole'
|
sql = 'SELECT * FROM md.protocole'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user