Esempio n. 1
0
    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)
Esempio n. 2
0
 def get(self):
     schema = IncomeSchema(many=True)
     incomes = schema.dump(
         filter(lambda t: t.type == TransactionType.INCOME, transactions))
     return jsonify(incomes.data)
Esempio n. 3
0
def add_income():
    income = IncomeSchema().load(request.get_json())
    transactions.append(income.data)
    return "",204
Esempio n. 4
0
def add_incomes():
    income = IncomeSchema().load(request.get_json())
    transactions.append(income)
    return '', 204