Skip to content

Commit

Permalink
[#2375] get featured groups from search facets
Browse files Browse the repository at this point in the history
  • Loading branch information
kindly committed Aug 13, 2012
1 parent a4780ad commit f939f99
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ckan/controllers/home.py
Expand Up @@ -143,15 +143,24 @@ def db_to_form_schema(group_type=None):
group_dict['packages'] = group_dict['packages'][:2]
return {'group_dict' :group_dict}

global dirty_cached_group_stuff
if not dirty_cached_group_stuff:
#global dirty_cached_group_stuff
#if not dirty_cached_group_stuff:
# ARON
# uncomment the first for testing
# the second for demo - different data
#dirty_cached_group_stuff = [get_group('access-to-medicines'), get_group('archaeology')]
dirty_cached_group_stuff = [get_group('data-explorer'), get_group('geo-examples')]
# dirty_cached_group_stuff = [get_group('data-explorer'), get_group('geo-examples')]

# c.groups is from the solr query above
if len(c.groups) == 1:
c.group_package_stuff = [get_group(c.groups[0]['name']),
{'group_dict' :{}}]
elif len(c.groups) == 2:
c.group_package_stuff = [get_group(c.groups[0]['name']),
get_group(c.groups[1]['name'])]
else:
c.group_package_stuff = [{'group_dict' :{}}, {'group_dict' :{}}]

c.group_package_stuff = dirty_cached_group_stuff
# END OF DIRTYNESS

return render('home/index.html', cache_force=True)
Expand Down

0 comments on commit f939f99

Please sign in to comment.