diff options
author | eliott <eliott@cactuswax.net> | 2008-04-10 06:27:23 +0200 |
---|---|---|
committer | eliott <eliott@cactuswax.net> | 2008-04-10 06:27:23 +0200 |
commit | a880de193fbf0d5b04bf4a17af428fa787015959 (patch) | |
tree | 24ea46adfd7dd48e7921ffcf454c00aa855ad86d | |
parent | 26aea7ab45ecb25dc61f6b046456f239d4277e17 (diff) | |
download | archweb-a880de193fbf0d5b04bf4a17af428fa787015959.tar.gz archweb-a880de193fbf0d5b04bf4a17af428fa787015959.tar.xz |
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.
-rw-r--r-- | main/models.py | 5 |
1 files 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('<li><a href="/packages/%d/">%s</a></li>' % \ (req.pkg.id,req.pkg.pkgname)) |