Created
March 18, 2015 16:56
-
-
Save jdunne-kaplan/7563b06e89f6e1fe43d8 to your computer and use it in GitHub Desktop.
Add deck_id to slidedecks asset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import models | |
from google.appengine.ext import ndb | |
opaqueID = '9f3cccbe-ee94-4bd6-9ba6-96efb1967ae4' | |
deck_asset = models.DBAsset.all().filter('opaqueID = ', opaqueID).filter('assetType = ', 'slidedecks').get() | |
asset = json.loads(deck_asset.asset) | |
# Add new deck_id: | |
asset["deck_ids"].append("4abd5f17-dd8b-42ec-a5e8-d9fecbeebdf9") | |
deck_asset.asset = json.dumps(asset) | |
# Update deck asset: | |
deck_asset.put() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment