summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-13 17:41:36 +0100
committerDan McGee <dan@archlinux.org>2011-03-13 17:41:36 +0100
commit5abe0727bfa9a4fab24afcccb66da7d8832bf6b9 (patch)
tree1b2f2bcce81e1b0b755698c4efdff29b9bd3075e /main
parent9730be60a8ef4a04358b0a026ce6b706de21d4e8 (diff)
downloadarchweb-5abe0727bfa9a4fab24afcccb66da7d8832bf6b9.tar.gz
archweb-5abe0727bfa9a4fab24afcccb66da7d8832bf6b9.tar.xz
Show epoch in package version if != 0
Add a full_version property method to our package object that does the version formatting, and switch all templates displaying package versions over to this new method. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index d0ccb12..727dc01 100644
--- a/main/models.py
+++ b/main/models.py
@@ -131,6 +131,12 @@ class Package(models.Model):
def __unicode__(self):
return self.pkgname
+ @property
+ def full_version(self):
+ if self.epoch > 0:
+ return u'%d:%s-%s' % (self.epoch, self.pkgver, self.pkgrel)
+ return u'%s-%s' % (self.pkgver, self.pkgrel)
+
def get_absolute_url(self):
return '/packages/%s/%s/%s/' % (self.repo.name.lower(),
self.arch.name, self.pkgname)