aboutsummaryrefslogtreecommitdiff
path: root/budget/models.py
diff options
context:
space:
mode:
authorAlexis Metaireau <ametaireau@gmail.com>2011-12-03 14:32:51 -0800
committerAlexis Metaireau <ametaireau@gmail.com>2011-12-03 14:32:51 -0800
commit5c4178b3b5b86bb6323775aa9e483e22a2a52937 (patch)
tree27b66d35575d5157d2c72a32409987eea0ed5264 /budget/models.py
parentc5a570073c454a6f3d50ce6bc35711c3a833ccc2 (diff)
parent1a5abcfbf2c9ceb137b42c177013bd0f54d571fe (diff)
downloadihatemoney-mirror-5c4178b3b5b86bb6323775aa9e483e22a2a52937.zip
ihatemoney-mirror-5c4178b3b5b86bb6323775aa9e483e22a2a52937.tar.gz
ihatemoney-mirror-5c4178b3b5b86bb6323775aa9e483e22a2a52937.tar.bz2
Merge pull request #72 from aavenel/master
Fix a crash in dashboard view
Diffstat (limited to 'budget/models.py')
-rw-r--r--budget/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/budget/models.py b/budget/models.py
index b889794..3dcd709 100644
--- a/budget/models.py
+++ b/budget/models.py
@@ -44,6 +44,10 @@ class Project(db.Model):
return balances
+ def has_bills(self):
+ """return if the project do have bills or not"""
+ return self.get_bills().count() != 0
+
def get_bills(self):
"""Return the list of bills related to this project"""
return Bill.query.join(Person, Project)\