summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-07 08:16:51 +0200
committerDan McGee <dan@archlinux.org>2012-08-07 08:16:53 +0200
commit7d9ed0b881bd05878e7a54f785c2551bc6e336d6 (patch)
tree790658dc0f8e253b15be626ab9d121c4f306e7c7 /main
parent8ca64af397718f7dda0080467d202c6a70a33c8c (diff)
downloadarchweb-7d9ed0b881bd05878e7a54f785c2551bc6e336d6.tar.gz
archweb-7d9ed0b881bd05878e7a54f785c2551bc6e336d6.tar.xz
Add reverse conflicts to package details
This is a place where calling vercmp could come in really handy. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 7d8ea75..b49edde 100644
--- a/main/models.py
+++ b/main/models.py
@@ -258,6 +258,16 @@ class Package(models.Model):
return (sort_order.get(dep.deptype, 1000), dep.name)
return sorted(deps, key=sort_key)
+ @cache_function(123)
+ def reverse_conflicts(self):
+ """
+ Returns a list of packages with conflicts against this package.
+ """
+ # TODO: fix this; right now we cheat since we can't do proper version
+ # number checking without using alpm or vercmp directly.
+ return Package.objects.filter(conflicts__name=self.pkgname,
+ conflicts__comparison='').distinct()
+
@cache_function(125)
def base_package(self):
"""