Mercurial > kallithea
comparison rhodecode/controllers/admin/repos_groups.py @ 1547:fbc762ae3496 beta
unified generation of repo groups choices
added on-the-fly conversion to new repository groups format (supporting path as a link)
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 11 Oct 2011 23:39:03 +0200 |
parents | ada6926c374f |
children | 2c0d35e336b5 |
comparison
equal
deleted
inserted
replaced
1546:c363267bbec7 | 1547:fbc762ae3496 |
---|---|
30 @LoginRequired() | 30 @LoginRequired() |
31 def __before__(self): | 31 def __before__(self): |
32 super(ReposGroupsController, self).__before__() | 32 super(ReposGroupsController, self).__before__() |
33 | 33 |
34 def __load_defaults(self): | 34 def __load_defaults(self): |
35 | 35 c.repo_groups = Group.groups_choices() |
36 c.repo_groups = [('', '')] | |
37 parents_link = lambda k: h.literal('»'.join(k)) | |
38 | |
39 c.repo_groups.extend([(x.group_id, parents_link(x.full_path_splitted)) | |
40 for x in self.sa.query(Group).all()]) | |
41 | |
42 c.repo_groups = sorted(c.repo_groups, | |
43 key=lambda t: t[1].split('»')[0]) | |
44 c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups) | 36 c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups) |
45 | 37 |
46 def __load_data(self, group_id): | 38 def __load_data(self, group_id): |
47 """ | 39 """ |
48 Load defaults settings for edit, and update | 40 Load defaults settings for edit, and update |