Models#

The coins app has one model: the concrete asset type Coin.

Coin#

Concrete subclass of Item via Django multi-table inheritance. Adds a coin_id field – a unique identifier used to disambiguate two coins sharing the same ticker symbol (see Coins).

The update_cache override invalidates the coin-specific transaction-performance / profit-performance cache keys and re-warms them by re-running Performance.

class richy.coins.models.Coin(id, symbol, type, is_discontinued, item_ptr, coin_id)[source]#

Bases: Item

Coin.update_cache()[source]#

Updates cached values cached by:

  • self.get_last_days_change(…)

  • self.get_sma(…)

  • self.get_ath()

  • self.get_drawdown()

  • self.get_52_weeks_low_high()

  • ItemWithPrices.refresh()