21 lines
591 B
Python
21 lines
591 B
Python
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()
|