summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2008-04-10 06:27:23 +0200
committereliott <eliott@cactuswax.net>2008-04-10 06:27:23 +0200
commita880de193fbf0d5b04bf4a17af428fa787015959 (patch)
tree24ea46adfd7dd48e7921ffcf454c00aa855ad86d
parent26aea7ab45ecb25dc61f6b046456f239d4277e17 (diff)
downloadarchweb-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.py5
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))