From f2e4fff07679542f506e2ac3f92a13a663e2cef5 Mon Sep 17 00:00:00 2001 From: Steven Valdez Date: Mon, 29 Apr 2013 22:12:46 -0400 Subject: [PATCH] More fixes for the sqlalchemy api --- code/validation.py | 7 ++++--- debian/changelog | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/code/validation.py b/code/validation.py index 18666be..26a49a3 100755 --- a/code/validation.py +++ b/code/validation.py @@ -107,9 +107,10 @@ def maxDisk(owner, machine=None): machine_id = machine.machine_id else: machine_id = None - disk_usage = Disk.query.filter(Disk.c.machine_id != machine_id).\ - join('machine').\ - filter_by(owner=owner).sum(Disk.c.size) or 0 + disk_usage_query = Disk.query.filter(Disk.machine_id != machine_id).\ + join('machine').filter_by(owner=owner) + + disk_usage = sum([m.size for m in disk_usage_query]) or 0 return min(quota_single, quota_total-disk_usage/1024.) def cantAddVm(owner, g): diff --git a/debian/changelog b/debian/changelog index 5dafef0..81276f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,12 @@ invirt-web (0.1.31) unstable; urgency=low -- Peter A. Iannucci Mon, 20 May 2013 09:00:00 -0400 +invirt-web (0.1.31~dvorak426) precise; urgency=low + + * More sqlalchemy api fixes. + + -- Steven Valdez Mon, 29 Apr 2013 22:11:49 -0400 + invirt-web (0.1.31~dvorak425) precise; urgency=low * Fixing use of query() vs query on cherrypy. -- 1.7.9.5