* force floating point operation for postgres

* documentation update

see #391
This commit is contained in:
Antoine Nguyen
2013-06-14 15:00:34 +02:00
parent 22a7b64cb7
commit 1e78648ecd
2 changed files with 108 additions and 1 deletions
+1 -1
View File
@@ -395,7 +395,7 @@ def list_quotas(request, tplname="admin/quotas.html"):
mboxes = mboxes.order_by("%s%s" % (sort_dir, sort_order))
elif sort_order == "quota_usage":
if db_type() == "postgres":
select = '(admin_quota.bytes / (CAST(admin_mailbox.quota AS BIGINT) * 1048576)) * 100'
select = '(admin_quota.bytes::float / (CAST(admin_mailbox.quota AS BIGINT) * 1048576)) * 100'
else:
select = 'admin_quota.bytes / (admin_mailbox.quota * 1048576) * 100'
mboxes = mboxes.extra(