def get(self, todo_id): # abort_if_todo_doesnt_exist(todo_id) schema = IncomeSchema(many=True) incomes = schema.dump( filter(lambda t: t.type == TransactionType.INCOME, transactions)) return jsonify(incomes.data)
def get(self): schema = IncomeSchema(many=True) incomes = schema.dump( filter(lambda t: t.type == TransactionType.INCOME, transactions)) return jsonify(incomes.data)
def add_income(): income = IncomeSchema().load(request.get_json()) transactions.append(income.data) return "",204
def add_incomes(): income = IncomeSchema().load(request.get_json()) transactions.append(income) return '', 204