Skip to content

Instantly share code, notes, and snippets.

@cwmanning
Created June 6, 2012 12:50
Show Gist options
  • Save cwmanning/2881639 to your computer and use it in GitHub Desktop.
Save cwmanning/2881639 to your computer and use it in GitHub Desktop.
generate stripped down asset collection
# Build an asset collection for front next/prev navigation
asset_collection = []
if item['name'] == 'hero' or item['name'] == 'headline-grid':
asset = {}
for content in item['contents']:
asset[u'headline'] = content.get('headline')
asset[u'links'] = content.get('links')
asset[u'photo'] = content.get('photo')
asset_collection.append(asset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment