summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-05-19 04:29:03 +0200
committerDan McGee <dan@archlinux.org>2012-05-19 04:36:11 +0200
commit72a92102df4999dbcc370064707c9026d51c4fe7 (patch)
tree7fe5be4bb93cb677952923899b954cc59e1b5e11 /main
parentcc44fdbea59596daf106e48acdb3f4137988d0d9 (diff)
downloadarchweb-72a92102df4999dbcc370064707c9026d51c4fe7.tar.gz
archweb-72a92102df4999dbcc370064707c9026d51c4fe7.tar.xz
Switch to usage of new Depend object
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/models.py b/main/models.py
index 4b445dd..f17d4a4 100644
--- a/main/models.py
+++ b/main/models.py
@@ -180,11 +180,12 @@ class Package(models.Model):
list slim by including the corresponding package in the same testing
category as this package if that check makes sense.
"""
+ from packages.models import Depend
provides = set(self.provides.values_list('name', flat=True))
provides.add(self.pkgname)
- requiredby = PackageDepend.objects.select_related('pkg',
+ requiredby = Depend.objects.select_related('pkg',
'pkg__arch', 'pkg__repo').filter(
- depname__in=provides).order_by(
+ name__in=provides).order_by(
'pkg__pkgname', 'pkg__arch__name', 'pkg__repo__name')
if not self.arch.agnostic:
# make sure we match architectures if possible
@@ -232,7 +233,7 @@ class Package(models.Model):
deps = []
arches = None
# TODO: we can use list comprehension and an 'in' query to make this more effective
- for dep in self.depends.order_by('optional', 'depname'):
+ for dep in self.depends.order_by('optional', 'name'):
pkg = dep.get_best_satisfier()
providers = None
if not pkg: