diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-01-19 00:42:18 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-01-19 00:42:18 -0300 |
commit | 27d7ccd7a928da74a881cf4fbd508e23613780fa (patch) | |
tree | ebed6ca44c1a5512b272685234ddfbb76fba76d8 /packages/utils.py | |
parent | 755a03d279631138cb982dc07b2d67b341a4f99c (diff) | |
parent | 523a15f81e819379d1d9ae8412ebd8a7c017a512 (diff) |
Merge branch 'master' of git://projects.archlinux.org/archweb
Conflicts:
templates/devel/clock.html
templates/packages/group_details.html
templates/packages/groups.html
Diffstat (limited to 'packages/utils.py')
-rw-r--r-- | packages/utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/utils.py b/packages/utils.py index 93d0de79..aaec0ec4 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -8,7 +8,7 @@ from main.utils import cache_function from .models import PackageGroup @cache_function(300) -def get_group_info(): +def get_group_info(include_arches=None): raw_groups = PackageGroup.objects.values_list( 'name', 'pkg__arch__name').order_by('name').annotate( cnt=Count('pkg'), last_update=Max('pkg__last_update')) @@ -38,10 +38,12 @@ def get_group_info(): new_g['arch'] = arch arch_groups[grp['name']] = new_g - # now transform it back into a sorted list + # now transform it back into a sorted list, including only the specified + # architectures if we got a list groups = [] - for val in group_mapping.itervalues(): - groups.extend(val.itervalues()) + for key, val in group_mapping.iteritems(): + if not include_arches or key in include_arches: + groups.extend(val.itervalues()) return sorted(groups, key=itemgetter('name', 'arch')) class Difference(object): |