From a880de193fbf0d5b04bf4a17af428fa787015959 Mon Sep 17 00:00:00 2001 From: eliott Date: Wed, 9 Apr 2008 21:27:23 -0700 Subject: Fix for required_by issue where all dependencies were listed, regardless of the architecture of the dep. Modified it so that only the current package's arch, as well as the 'any' arch, are valid for required by listing. --- main/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/models.py b/main/models.py index e54fa50..62f230c 100644 --- a/main/models.py +++ b/main/models.py @@ -194,8 +194,9 @@ class Package(models.Model): def required_by_urlize(self): urls = [] - requiredby = PackageDepend.objects.filter( - depname=self.pkgname).order_by('depname') + requiredby = PackageDepend.objects.filter(depname=self.pkgname).filter( + Q(pkg__arch=self.arch) | Q(pkg__arch__name__iexact='any') + ).order_by('depname') for req in requiredby: urls.append('
  • %s
  • ' % \ (req.pkg.id,req.pkg.pkgname)) -- cgit v1.2.3-24-g4f1b