[Pkg-debile-commits] [debile-web] 01/01: Sqlalchemy sometimes use BOOLEAN and sometimes SMALLINT for Boolean columns, work with both.
Jon Severinsson
jonno-guest at moszumanska.debian.org
Sun May 18 13:56:29 UTC 2014
This is an automated email from the git hooks/post-receive script.
jonno-guest pushed a commit to branch master
in repository debile-web.
commit aecc75765cdb36d416808be16f7afd14b3f7de51
Author: Jon Severinsson <jon at severinsson.net>
Date: Sun May 18 15:54:17 2014 +0200
Sqlalchemy sometimes use BOOLEAN and sometimes SMALLINT for Boolean columns, work with both.
---
debileweb/blueprints/frontend.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/debileweb/blueprints/frontend.py b/debileweb/blueprints/frontend.py
index dfee9e5..04c9955 100644
--- a/debileweb/blueprints/frontend.py
+++ b/debileweb/blueprints/frontend.py
@@ -24,7 +24,7 @@
from flask import Blueprint, render_template, request, redirect
from flask.ext.jsonpify import jsonify
from debian.debian_support import Version
-from sqlalchemy.sql import func, select, asc
+from sqlalchemy.sql import func, select, asc, case
from debile.master.utils import Session
from debile.master.orm import (Person, Builder, Suite, Check, Group, GroupSuite,
@@ -220,7 +220,7 @@ def sources(search="", prefix="recent", page=0):
).order_by(
asc(select([func.min(
Job.assigned_count - select([func.count(1)]).where(job_dependencies.c.blocking_job_id == Job.id) +
- 4 * Suite.name.in_(["staging", "sid", "experimental"]) - 8 * Check.build
+ case([(Suite.name.in_(["staging", "sid", "experimental"]), 4)], else_=0) - case([(Check.build, 8)], else_=0)
)]).where(
(Job.source_id == Source.id) &
~Job.depedencies.any() &
@@ -326,7 +326,7 @@ def jobs(prefix="recent", page=0):
Job.failed.is_(None),
).order_by(
asc(Job.assigned_count - select([func.count(1)]).where(job_dependencies.c.blocking_job_id == Job.id) +
- 4 * Suite.name.in_(["staging", "sid", "experimental"]) - 8 * Check.build),
+ case([(Suite.name.in_(["staging", "sid", "experimental"]), 4)], else_=0) - case([(Check.build, 8)], else_=0)),
Source.uploaded_at.asc(),
)
elif prefix == "unbuilt":
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-web.git
More information about the Pkg-debile-commits
mailing list