summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-24 03:24:15 +0200
committerDan McGee <dan@archlinux.org>2011-06-24 03:25:06 +0200
commit5bf28d1cabc54dfa68ff64804a31ead419780fdf (patch)
tree2e7a252edc228dcada21375407758a853e62a8a7 /main
parent55f6ad0c95323a5bfeca2c322918d21f413d1075 (diff)
downloadarchweb-5bf28d1cabc54dfa68ff64804a31ead419780fdf.tar.gz
archweb-5bf28d1cabc54dfa68ff64804a31ead419780fdf.tar.xz
Add Package.in_staging method
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/models.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index e001706..b52c45f 100644
--- a/main/models.py
+++ b/main/models.py
@@ -332,6 +332,17 @@ class Package(models.Model):
except Package.DoesNotExist:
return None
+ def in_staging(self):
+ '''attempt to locate this package in a staging repo; if we are in
+ a staging repo we will always return None.'''
+ if self.repo.staging:
+ return None
+ try:
+ return Package.objects.normal().get(repo__staging=True,
+ pkgname=self.pkgname, arch=self.arch)
+ except Package.DoesNotExist:
+ return None
+
def elsewhere(self):
'''attempt to locate this package anywhere else, regardless of
architecture or repository. Excludes this package from the list.'''