code: def __calculate_current_value(self, asset_class: AssetClass):
          
          # Is this the final asset class, the one with stocks?
          if asset_class.stocks:
              # add all the stocks
              stocks_sum = Decimal(0)
              for stock in asset_class.stocks:
                  # recalculate into base currency!
                  stocks_sum += stock.value_in_base_currency
  
              asset_class.curr_value = stocks_sum
  
          if asset_class.classes:
              # load totals for child classes
              for child in asset_class.classes:
                  self.__calculate_current_value(child)
                  asset_class.curr_value += child.curr_value
docs: Calculate totals for asset class by adding all the children values