def getEntryMsg(self): title = '{:^79}'.format('Category Management') categories = db.get_categories() if categories: body = fmt.categories_list(categories) else: body = 'No categories currently defined' return title + os.linesep * 3 + body
def __init__(self, parentState, account): userDataStates = [ DateInputState(self, 'date', 'Date'), BounceInputState(self, 'description', 'Description'), SelectCategoryState(self, db.get_categories(), 'category'), AmountInputState(self, 'amount', 'Amount'), ] actionState = AccountPaymentActionState( self, 'Confirm new payment transaction') CollectDataState.__init__(self, parentState, userDataStates, actionState) self.collectedData['from_account'] = account['ID']
def __init__(self, parentState, from_account, to_account): userDataStates = [ DateInputState(self, 'date', 'Date'), BounceInputState(self, 'description', 'Description'), SelectCategoryState(self, db.get_categories(), 'category'), AmountInputState(self, 'amount', 'Amount'), ] actionState = AccountTransferActionState( self, 'Confirm new transfer between accounts') CollectDataState.__init__(self, parentState, userDataStates, actionState) self.collectedData['from_account'] = from_account['ID'] self.collectedData['to_account'] = to_account['ID']