From d9e9e3f2a0c1ea4dcbb6ffedc4eec63903ac6113 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Thu, 25 May 2017 21:22:00 +0200 Subject: [PATCH] Cleanup old functions. --- accountant/models/accounts.py | 8 -------- accountant/views/accounts.py | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/accountant/models/accounts.py b/accountant/models/accounts.py index d8f768b..ceb1467 100644 --- a/accountant/models/accounts.py +++ b/accountant/models/accounts.py @@ -27,10 +27,6 @@ class Account(db.Model): cls.name ) - def solds(self): - """Return the balances of this account.""" - return self.balances() - def balances(self): """Return the balances of this account.""" return db.session.query( @@ -53,10 +49,6 @@ class Account(db.Model): Operation.account_id == self.id ).one() - def balance(self, begin, end): - """Return the flow for a specific time period.""" - return self.flow(begin, end) - def flow(self, begin, end): """Return the flow for a specific time period.""" query = db.session.query( diff --git a/accountant/views/accounts.py b/accountant/views/accounts.py index 2e92125..b9cab8e 100644 --- a/accountant/views/accounts.py +++ b/accountant/views/accounts.py @@ -264,7 +264,7 @@ class SoldsResource(Resource): # Note: if we don't pass the code, the result is seen as a tuple and # causes error on marshalling. - return account.solds(), 200 + return account.balances(), 200 @ns.route('//balance') @@ -296,7 +296,7 @@ class BalanceResource(Resource): # Note: if we don't pass the code, the result is seen as a tuple and # causes error on marshalling. - return account.balance(**data), 200 + return account.flow(**data), 200 @ns.route("//category")