Mercurial > public > src > rhodecode
comparison pylons_app/controllers/repos.py @ 246:ca80f8c00562 v0.7.6
Fixed bug in repos, added dependencies and bumped version
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 03 Jun 2010 01:01:36 +0200 |
parents | fcab58c43ea1 |
children | 51434007e21d |
comparison
equal
deleted
inserted
replaced
245:a83a1799480c | 246:ca80f8c00562 |
---|---|
3 from pylons.controllers.util import abort, redirect | 3 from pylons.controllers.util import abort, redirect |
4 from pylons_app.lib.auth import LoginRequired | 4 from pylons_app.lib.auth import LoginRequired |
5 from pylons_app.lib.base import BaseController, render | 5 from pylons_app.lib.base import BaseController, render |
6 from pylons_app.lib.filters import clean_repo | 6 from pylons_app.lib.filters import clean_repo |
7 from pylons_app.lib.utils import check_repo, invalidate_cache | 7 from pylons_app.lib.utils import check_repo, invalidate_cache |
8 from pylons_app.model.hg_model import HgModel | |
8 import logging | 9 import logging |
9 import os | 10 import os |
10 import shutil | 11 import shutil |
12 from operator import itemgetter | |
11 log = logging.getLogger(__name__) | 13 log = logging.getLogger(__name__) |
12 | 14 |
13 class ReposController(BaseController): | 15 class ReposController(BaseController): |
14 """REST Controller styled on the Atom Publishing Protocol""" | 16 """REST Controller styled on the Atom Publishing Protocol""" |
15 # To properly map this controller, ensure your config/routing.py | 17 # To properly map this controller, ensure your config/routing.py |
22 super(ReposController, self).__before__() | 24 super(ReposController, self).__before__() |
23 | 25 |
24 def index(self, format='html'): | 26 def index(self, format='html'): |
25 """GET /repos: All items in the collection""" | 27 """GET /repos: All items in the collection""" |
26 # url('repos') | 28 # url('repos') |
27 c.repos_list = c.cached_repo_list | 29 cached_repo_list = HgModel().get_repos() |
30 c.repos_list = sorted(cached_repo_list, key=itemgetter('name')) | |
28 return render('admin/repos/repos.html') | 31 return render('admin/repos/repos.html') |
29 | 32 |
30 def create(self): | 33 def create(self): |
31 """POST /repos: Create a new item""" | 34 """POST /repos: Create a new item""" |
32 # url('repos') | 35 # url('repos') |