Example #1
0
 def _one_exchange(self):
     markets = self._get_markets_by_exchange()
     prices = self._get_tickers_by_exchange()
     for symbol in markets:
         item, created = Markets.get_or_create(exchange=self.exchange,
                                               symbol=symbol)
         if created:
             item.save()
         item.update_data(markets[symbol])
         item.update_prices(prices[symbol])
         item.save()
Example #2
0
 def run(self):
     logging.info(f"Updating markets of {self.exchange.title()}")
     markets = self._get_markets_by_exchange()
     # tickers = self._get_tickers_by_exchange()
     for symbol in markets:
         item, created = Markets.get_or_create(exchange=self.exchange,
                                               symbol=symbol)
         if created:
             item.save()
         item.update_data(markets[symbol])
     self.onFinished.emit()