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