From d4155f7d0fcec64f45f713e5bfdd33db990023b0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 3 Mar 2010 21:07:26 -0600 Subject: Use repo.testing flag instead of test-based checks Signed-off-by: Dan McGee --- main/models.py | 2 +- packages/views.py | 8 ++++---- templates/packages/details.html | 4 ++-- todolists/views.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main/models.py b/main/models.py index abbe050b..a022b8eb 100644 --- a/main/models.py +++ b/main/models.py @@ -249,7 +249,7 @@ def get_depends(self): elif len(pkgs) == 1: deps.append({'dep': dep, 'pkg': pkgs[0]}) else: - tpkgs = pkgs.filter(repo__name='Testing') + tpkgs = pkgs.filter(repo__testing=True) if len(tpkgs) == 1: deps.append({'dep': dep, 'pkg': tpkgs[0]}) else: diff --git a/packages/views.py b/packages/views.py index 8a2b4ec3..6bd54a66 100644 --- a/packages/views.py +++ b/packages/views.py @@ -198,11 +198,11 @@ def unflag(request, pkgid): @permission_required('main.change_package') def signoffs(request): - packages = Package.objects.select_related('arch', 'repo', 'signoffs').filter(repo__name__endswith="Testing").order_by("pkgname") + packages = Package.objects.select_related('arch', 'repo', 'signoffs').filter(repo__testing=True).order_by("pkgname") package_list = [] - q_pkgname = Package.objects.filter(repo__name__endswith="Testing").values('pkgname').distinct().query - package_repos = Package.objects.values('pkgname', 'repo__name').exclude(repo__name__endswith="Testing").filter(pkgname__in=q_pkgname) + q_pkgname = Package.objects.filter(repo__testing=True).values('pkgname').distinct().query + package_repos = Package.objects.values('pkgname', 'repo__name').exclude(repo__testing=True).filter(pkgname__in=q_pkgname) pkgtorepo = dict() for pr in package_repos: pkgtorepo[pr['pkgname']] = pr['repo__name'] @@ -221,7 +221,7 @@ def signoff_package(request, arch, pkgname): pkg = get_object_or_404(Package, arch__name=arch, pkgname=pkgname, - repo__name="Testing") + repo__testing=True) signoff, created = Signoff.objects.get_or_create( pkg=pkg, diff --git a/templates/packages/details.html b/templates/packages/details.html index 496ca424..def07501 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -77,7 +77,7 @@

Dependencies ({{deps|length}}):

{% ifequal depend.pkg None %}
  • {{ depend.dep.depname }} (virtual)
  • {% else %} -
  • {{ depend.dep.depname }}{{ depend.dep.depvcmp }}{% ifequal depend.pkg.repo.name "Testing" %} (testing){% endifequal %}
  • +
  • {{ depend.dep.depname }}{{ depend.dep.depvcmp }}{% if depend.pkg.repo.testing %} (testing){% endif %}
  • {% endifequal %} {% endfor %} @@ -92,7 +92,7 @@

    Required By ({{rqdby|length}}):

    {% if rqdby %} {% endif %} diff --git a/todolists/views.py b/todolists/views.py index f176e39c..411c0dbb 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -27,7 +27,7 @@ def clean_packages(self): package_names = set(package_names) packages = Package.objects.filter( pkgname__in=package_names).exclude( - repo__name__endswith="Testing").order_by('arch') + repo__testing=True).order_by('arch') return packages -- cgit v1.2.3-54-g00ecf