summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-04-18 23:26:10 -0500
committerDan McGee <dan@archlinux.org>2011-04-18 23:26:13 -0500
commitf1f01ecf0216441dd66f3bc6afc14fe104de291f (patch)
treee9cb94fdbbc92c29f40bde47b05b6f1020e4549b /main/models.py
parentd8022fd5720a8367a03bbff58668ed701a0bebcf (diff)
Reimplement links code as template tags
These were starting to get a bit too much inside the model itself, and they don't really belong there as they are view layer concerns anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/main/models.py b/main/models.py
index d84a6af3..e8f189e7 100644
--- a/main/models.py
+++ b/main/models.py
@@ -8,7 +8,6 @@ from packages.models import PackageRelation
from datetime import datetime
from itertools import groupby
import pytz
-from urllib import urlencode
class UserProfile(models.Model):
notify = models.BooleanField(
@@ -282,29 +281,6 @@ class Package(models.Model):
return Package.objects.filter(arch__in=self.applicable_arches(),
repo__testing=self.repo.testing, pkgbase=self.pkgbase).exclude(id=self.id)
- def get_svn_link(self, svnpath):
- linkbase = "http://projects.archlinux.org/svntogit/%s.git/tree/%s/%s/"
- return linkbase % (self.repo.svn_root, self.pkgbase, svnpath)
-
- def get_arch_svn_link(self):
- repo = self.repo.name.lower()
- return self.get_svn_link("repos/%s-%s" % (repo, self.arch.name))
-
- def get_trunk_svn_link(self):
- return self.get_svn_link("trunk")
-
- def get_bugs_link(self):
- return "https://bugs.archlinux.org/?project=%d&string=%s" % \
- (self.repo.bugs_project, self.pkgname)
-
- def get_bug_report_link(self):
- data = {
- 'project': self.repo.bugs_project,
- 'product_category': self.repo.bugs_category,
- 'item_summary': '[%s]' % self.pkgname,
- }
- return "https://bugs.archlinux.org/newtask?%s" % urlencode(data)
-
def is_same_version(self, other):
'is this package similar, name and version-wise, to another'
return self.pkgname == other.pkgname \