aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-11-11 01:07:48 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2007-11-11 01:07:48 +0000
commitf84fb57b6af8aff79d8fe66e1c92e14b3758325e (patch)
tree583a5494cdfcf236377cda3105debdc466777dfb /web
parentUse memcache. (diff)
downloadpackages-f84fb57b6af8aff79d8fe66e1c92e14b3758325e.tar.gz
packages-f84fb57b6af8aff79d8fe66e1c92e14b3758325e.tar.bz2
packages-f84fb57b6af8aff79d8fe66e1c92e14b3758325e.zip
Factor out forums URL.
Diffstat (limited to 'web')
-rw-r--r--web/lib/links.py3
-rw-r--r--web/model.py9
2 files changed, 9 insertions, 3 deletions
diff --git a/web/lib/links.py b/web/lib/links.py
index 7bae06f..0f1d28d 100644
--- a/web/lib/links.py
+++ b/web/lib/links.py
@@ -65,4 +65,7 @@ def ciavc_link(username):
"""Given a username, give link to the relevant CIA.vc entry"""
return 'http://cia.vc/stats/author/%s' % (username)
+def forums_search_link(query):
+ return 'http://forums.gentoo.org/search.php?search_terms=all&show_results=topics&mode=results&search_keywords=%s' % (query)
+
# vim:ts=4 et ft=python:
diff --git a/web/model.py b/web/model.py
index 062ca02..ad5f259 100644
--- a/web/model.py
+++ b/web/model.py
@@ -8,8 +8,11 @@ from DBUtils.PersistentDB import PersistentDB
from DBUtils.PooledDB import PooledDB
from etc.const_data import ConstData
-from web.lib.changelog_formatter import pretty_changelog, optimal_collapse
-from web.lib.links import viewcvs_link, bugzilla_search_link
+from web.lib.changelog_formatter import pretty_changelog, \
+ optimal_collapse
+from web.lib.links import viewcvs_link, \
+ bugzilla_search_link, \
+ forums_search_link
# We use short variable names!
# pylint: disable-msg=C0103
@@ -407,7 +410,7 @@ class PackageDB(object):
pkg['changelog'] = viewcvs_link('%s/ChangeLog' % (atom.key))
pkg['bugzilla'] = bugzilla_search_link(pn)
- pkg['forums'] = 'http://forums.gentoo.org/search.php?search_terms=all&show_results=topics&mode=results&search_keywords=%s' % (pn)
+ pkg['forums'] = forums_search_link(pn)
return pkg
def get_package_details(self, cat, pn):