Testeado el batch de indices en dev.
This commit is contained in:
parent
d71b69a611
commit
c234679a10
7 changed files with 170 additions and 23 deletions
21
db_layer/indices_interface.py
Normal file
21
db_layer/indices_interface.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
from core.mysql_wrapper import get_anunciosdb
|
||||
|
||||
|
||||
class IndicesInterface:
|
||||
|
||||
def __init__(self):
|
||||
self.anunciosdb = get_anunciosdb()
|
||||
|
||||
def write_index(self, index_data):
|
||||
query_statement = """ REPLACE INTO valores_indices
|
||||
(fecha_valor, nombre_indice, valor_indice)
|
||||
VALUES
|
||||
(%(date)s, %(name)s, %(value)s)
|
||||
"""
|
||||
|
||||
query_parameters = index_data
|
||||
|
||||
self.anunciosdb.query(query_statement, query_parameters)
|
||||
|
||||
|
||||
indices_interface = IndicesInterface()
|
||||
Loading…
Add table
Add a link
Reference in a new issue