--- a/candolint/handlers.py Wed Sep 20 13:44:36 2017 +0800
+++ b/candolint/handlers.py Sat Sep 23 12:42:03 2017 +0800
- .group_by(Check.project))
+ .group_by(Check.project)
+ .order_by(Check.finished.desc(), Check.ordinal.desc()))
self.render('index.html', checks=checks)
.select(Change, *Check.get_light_fields())
- .where(Check.project == project))
+ .where(Check.project == project)
+ .order_by(Check.ordinal.desc()))
self.render('project.html', project=project, checks=checks)
.select(Change, *Check.get_light_fields())
- .where(Check.project == project))
+ .where(Check.project == project)
+ .order_by(Check.ordinal.desc()))
.select(*Check.get_light_fields())
.where(Check.project == check.project)
- .where(Change.branch == check.change.branch))
+ .where(Change.branch == check.change.branch)
+ .order_by(Check.ordinal.desc()))
more = checks.where(Check.ordinal >= check.ordinal).count()
history = list(reversed(checks
- .order_by(Check.ordinal.desc())
.offset(max(0, more - limit))))
project = get_project_or_404(domain, user, name)
.select(*Check.get_light_fields())
- .where(Check.project == project))
+ .where(Check.project == project)
+ .order_by(Check.ordinal.desc()))
branch = self.get_argument('branch', None)
checks = checks.join(Change).where(Change.branch == branch)
project = get_project_or_404(domain, user, name)
.select(*Check.get_light_fields())
- .where(Check.project == project))
+ .where(Check.project == project)
+ .order_by(Check.ordinal.desc()))
if check_num != 'latest':
checks = checks.where(Check.ordinal == check_num)
branch = self.get_argument('branch', None)
--- a/candolint/models.py Wed Sep 20 13:44:36 2017 +0800
+++ b/candolint/models.py Sat Sep 23 12:42:03 2017 +0800
change = pw.ForeignKeyField(Change, related_name='checks')
- order_by = ('-finished', '-ordinal')
(('ordinal', 'project'), True),
(('project', 'finished', 'ordinal'), True)