def __fillPriceModel(self, priceModel, price, checkResult): prices = priceModel.getPrice() prices.clear() for currency, amount in price.iteritems(): itemPriceModel = PriceItemModel() itemPriceModel.setName(currency) itemPriceModel.setValue(amount) itemPriceModel.setIsEnough(checkResult.result) prices.addViewModel(itemPriceModel) prices.invalidate()
def _initialize(self): super(ExchangePanelModel, self)._initialize() self._addViewModelProperty('fromItem', PriceItemModel()) self._addViewModelProperty('toItem', PriceItemModel()) self._addViewModelProperty('exchangeRate', ExchangeRateModel())
def _initialize(self): super(DialogWithExchange, self)._initialize() self._addViewModelProperty('exchangePanel', ExchangePanelModel()) self._addViewModelProperty('lacksMoney', PriceItemModel()) self._addStringProperty('bottomContentType', '') self._addStringProperty('exchangeState', 'default')
def _createPriceItemModel(cls, name, value): priceItemModel = PriceItemModel() priceItemModel.setName(name) priceItemModel.setValue(value) return priceItemModel