Skip to content

Commit

Permalink
Added categories to extras
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Sep 28, 2018
1 parent ab7cd61 commit 9ec7cd8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ckanext/socrata/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ def _build_package_dict(self, context, harvest_object):
'value': res.get('owner', {}).get('display_name')
})

# Add categories to extras
package_dict['extras'].append({
'key': 'categories',
'value': [t
for t in res['classification'].get('categories', [])
+ res['classification'].get('domain_categories', [])],
})

# Add Socrata metadata.license if available
if res['metadata'].get('license', False):
package_dict['extras'].append({
Expand Down

0 comments on commit 9ec7cd8

Please sign in to comment.