From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4202D1390EB for ; Wed, 22 Jul 2015 21:25:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8A7A4E0894; Wed, 22 Jul 2015 21:25:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1B3A8E0894 for ; Wed, 22 Jul 2015 21:25:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E3F59340873 for ; Wed, 22 Jul 2015 21:25:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1D5F0AF for ; Wed, 22 Jul 2015 21:25:28 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1437600284.f66e4386ffe1b5f48a8f7986d6cc4371d7862b85.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/tbc_www/, python/templates/pages/packages/ebuilds/ X-VCS-Repository: proj/tinderbox-cluster-www X-VCS-Files: python/tbc_www/models.py python/tbc_www/views.py python/templates/pages/packages/ebuilds/index.html X-VCS-Directories: python/tbc_www/ python/templates/pages/packages/ebuilds/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: f66e4386ffe1b5f48a8f7986d6cc4371d7862b85 X-VCS-Branch: master Date: Wed, 22 Jul 2015 21:25:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4642e504-3059-4a7d-a190-91e5cbb17471 X-Archives-Hash: fa0587e4d3c0c569d024a3bda203b036 commit: f66e4386ffe1b5f48a8f7986d6cc4371d7862b85 Author: Magnus Granberg gentoo org> AuthorDate: Wed Jul 22 21:24:44 2015 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Wed Jul 22 21:24:44 2015 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=f66e4386 add keywords to version view python/tbc_www/models.py | 18 ++++++++++++++++++ python/tbc_www/views.py | 8 ++++---- python/templates/pages/packages/ebuilds/index.html | 20 ++++++++++++++++---- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py index 3d284c2..9827583 100644 --- a/python/tbc_www/models.py +++ b/python/tbc_www/models.py @@ -150,3 +150,21 @@ class BuildJobsUse(models.Model): db_table = 'build_jobs_use' def __str__(self): return '%s %s %s %s' % (self.Id, self.BuildJobId, self.UseId, self.Status) + +class Keywords(models.Model): + KeywordId = models.IntegerField(primary_key=True, db_column='keyword_id') + Keyword = models.CharField(max_length=45, db_column='keyword') + class Meta: + db_table = 'keywords' + def __str__(self): + return '%s %s' % (self.KeywordId, self.Keyword) + +class EbuildsKeywords(models.Model): + Id = models.IntegerField(primary_key=True, db_column='id') + EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id') + KeywordId = models.ForeignKey(Keywords, db_column='keyword_id') + Status = models.CharField(max_length=24, db_column='status') + class Meta: + db_table = 'ebuilds_keywords' + def __str__(self): + return '%s %s %s' % (self.EbuildId, self.KeywordId, self.Status) diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py index a025cbf..84ff9e6 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 + Repos, EbuildsKeywords import re def default_TmpDict(pagerequest): @@ -106,10 +106,10 @@ def packages(request, category_id): def ebuilds(request, package_id): pagerequest = 'packages' TmpDict = default_TmpDict(pagerequest) - P = get_object_or_404(Packages, PackageId = package_id) + P = get_object_or_404(PackagesMetadata, PackageId__PackageId = package_id) TmpDict['P'] = P - TmpDict['EM_tmp'] = EbuildsMetadata.objects.filter(EbuildId__Active = True).filter(EbuildId__PackageId__Package = P.Package) - print(TmpDict) + TmpDict['EM_tmp'] = EbuildsMetadata.objects.filter(EbuildId__Active = True).filter(EbuildId__PackageId__Package = P.PackageId.Package) + TmpDict['EK_tmp'] = EbuildsKeywords.objects.filter(EbuildId__Active = True).filter(EbuildId__PackageId__Package = P.PackageId.Package) return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', TmpDict) def new(request): diff --git a/python/templates/pages/packages/ebuilds/index.html b/python/templates/pages/packages/ebuilds/index.html index 73f45f2..1e034d4 100644 --- a/python/templates/pages/packages/ebuilds/index.html +++ b/python/templates/pages/packages/ebuilds/index.html @@ -1,14 +1,26 @@ {% extends "layout/base.html" %} {% block content %}
-
-

{{ P.CategoryId.Category }}/{{ P.Package }}

+
+

{{ P.PackageId.CategoryId.Category }}/{{ P.PackageId.Package }}

+

Changlog

+

{{ P.Changlog|linebreaksbr }}

{% for E in EM_tmp %} - + {{ P.PackageId.Package }}-{{ E.EbuildId.Version }}::{{ E.EbuildId.PackageId.RepoId.Repo }} + + {% endfor %}
- {{ P.Package }}-{{ E.EbuildId.Version }}::{{ E.EbuildId.PackageId.RepoId.Repo }}

+ + {% for K in EK_tmp %} + {% if K.EbuildId.EbuildId == E.EbuildId.EbuildId and K.KeywordId.Keyword != '*' %} + {% if K.Status == 'Stable' %}{{ K.KeywordId.Keyword }}{% endif %} + {% if K.Status == 'Unstable' %}{{ K.KeywordId.Keyword }}{% endif %} + {% if K.Status == 'Negative' %}{{ K.KeywordId.Keyword }}{% endif %} + {% endif %} + {% endfor %} +