summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2008-04-09 21:27:23 -0700
committereliott <eliott@cactuswax.net>2008-04-09 21:27:23 -0700
commita880de193fbf0d5b04bf4a17af428fa787015959 (patch)
tree24ea46adfd7dd48e7921ffcf454c00aa855ad86d /main/models.py
parent26aea7ab45ecb25dc61f6b046456f239d4277e17 (diff)
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.
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/models.py b/main/models.py
index e54fa502..62f230c9 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))