diff options
Diffstat (limited to 'python/tbc_www/views.py')
-rw-r--r-- | python/tbc_www/views.py | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py index 58f186e..108a653 100644 --- a/python/tbc_www/views.py +++ b/python/tbc_www/views.py @@ -5,7 +5,8 @@ from django.shortcuts import render, get_object_or_404, HttpResponseRedirect 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 +from tbc_www.models import EbuildsMetadata, BuildLogs, BuildJobs, BuildLogsRepomanQa, \ + BuildJobsUse import re @@ -29,9 +30,41 @@ def default_TmpDict(pagerequest): def home(request): pagerequest = 'home' Lines = 10 + 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] - TmpDict['BJ'] = BuildJobs.objects.order_by('-TimeStamp')[:Lines] + BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines] + for BJ in BJ_Tmp: + adict2 = {} + adict2['EbuildId'] = BJ.EbuildId.EbuildId + adict2['C'] = BJ.EbuildId.PackageId.CategoryId.Category + adict2['P'] = BJ.EbuildId.PackageId.Package + adict2['V'] = BJ.EbuildId.Version + adict2['R'] = BJ.EbuildId.PackageId.RepoId.Repo + adict2['Profile'] = BJ.ConfigId.SetupId.Profile + adict2['Setup'] = BJ.ConfigId.SetupId.Setup + adict2['title'] = "Setup: " + BJ.ConfigId.SetupId.Setup + "\n" + "Profile: " + BJ.ConfigId.SetupId.Profile + "\n" + BJU = BuildJobsUse.objects.filter(BuildJobId = BJ.BuildJobId) + if not BJU == []: + use_enable = [] + use_disable = [] + for BU in BJU: + if BU.Status: + use_enable.append(BU.UseId.Flag) + else: + use_disable.append(BU.UseId.Flag) + if not use_enable == []: + adict2['title'] = adict2['title'] + "Enable: " + for use in use_enable: + adict2['title'] = adict2['title'] + use + " " + adict2['title'] = adict2['title'] + "\n" + if not use_disable == []: + adict2['title'] = adict2['title'] + "Disable: " + for use in use_disable: + adict2['title'] = adict2['title'] + use + " " + adict2['title'] = adict2['title'] + "\n" + adict[BJ.BuildJobId] = adict2 + TmpDict['BJ'] = adict TmpDict['RM'] = BuildLogsRepomanQa.objects.order_by('-Id')[:Lines] return render(request, 'pages/' + pagerequest + '/index.html', TmpDict) |