summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'python/tbc_www/views.py')
-rw-r--r--python/tbc_www/views.py34
1 files changed, 29 insertions, 5 deletions
diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 2559f8d..f68a706 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -7,7 +7,7 @@ from django.conf import settings
from gentoo_www.models import SiteSettings, Layout, Pages, SubPages, Sponsors, Posts
from tbc_www.models import EbuildsMetadata, BuildLogs, BuildJobs, BuildLogsRepomanQa, \
BuildJobsUse, Categories, CategoriesMetadata, Packages, PackagesMetadata, Ebuilds, \
- Repos, EbuildsKeywords
+ Repos, EbuildsKeywords, BuildLogsErrors
import re
def default_TmpDict(pagerequest):
@@ -30,10 +30,22 @@ def default_TmpDict(pagerequest):
def home(request):
pagerequest = 'home'
Lines = 5
- adict = {}
TmpDict = default_TmpDict(pagerequest)
TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
- TmpDict['BL'] = BuildLogs.objects.order_by('-TimeStamp')[:Lines]
+ adict = {}
+ for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
+ adict2 = {}
+ adict2['C'] = BL.EbuildId.PackageId.CategoryId.Category
+ adict2['P'] = BL.EbuildId.PackageId.Package
+ adict2['V'] = BL.EbuildId.Version
+ adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo
+ adict2['Fail'] = BL.Fail
+ adict2['SummeryText'] = BL.SummeryText
+ if BL.Fail:
+ adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ adict[BL.BuildLogId] = adict2
+ TmpDict['BL'] = adict
+ adict = {}
BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
for BJ in BJ_Tmp:
adict2 = {}
@@ -115,10 +127,22 @@ def ebuilds(request, package_id):
def new_main(request):
pagerequest = 'new'
Lines = 30
- adict = {}
TmpDict = default_TmpDict(pagerequest)
TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
- TmpDict['BL'] = BuildLogs.objects.order_by('-TimeStamp')[:Lines]
+ adict = {}
+ for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
+ adict2 = {}
+ adict2['C'] = BL.EbuildId.PackageId.CategoryId.Category
+ adict2['P'] = BL.EbuildId.PackageId.Package
+ adict2['V'] = BL.EbuildId.Version
+ adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo
+ adict2['Fail'] = BL.Fail
+ adict2['SummeryText'] = BL.SummeryText
+ if BL.Fail:
+ adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+ adict[BL.BuildLogId] = adict2
+ TmpDict['BL'] = adict
+ adict = {}
BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
for BJ in BJ_Tmp:
adict2 = {}