Testeado el batch de indices en dev.

This commit is contained in:
pablomartincalvo 2018-12-23 18:30:11 +01:00
parent d71b69a611
commit c234679a10
7 changed files with 170 additions and 23 deletions

View 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()