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 models | |
import json | |
from lib.utils import DateTimeJSONEncoder | |
deck_id = "558a3de6-9019-4ee8-9c18-1cad41346d50" | |
new_deck_url = "https://s3.amazonaws.com/slides.kaplan.com/PACE/8980c532-2e99-414f-acb3-5c99702f418e/data" | |
deckA = models.SlideDeck.get_by_id(deck_id) | |
deckA.deck_url = new_deck_url |
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: |
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) | |
keys = [ndb.Key(models.SlideDeck, id) for id in asset["deck_ids"]] |
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 models | |
from google.appengine.ext import ndb | |
import lib | |
from lib.utils import AsyncBatchUpdateManager | |
from lib.utils import QueryBatchIterator | |
session = models.DBSession.get_by_key_name('9f3cccbe-ee94-4bd6-9ba6-96efb1967ae4') | |
tle_query = models.TimelineEvent.query_ordered_versioned(session, timeline_version=2)\ |
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 models | |
from google.appengine.ext import ndb | |
import lib | |
lib.session.create_participant( | |
opaqueID='TODO', | |
firstName='KAPx', | |
lastName='Developer', | |
username='kapxdev', | |
emailAddress='[email protected]', |
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 models | |
from google.appengine.ext import ndb | |
ids = ['TODO'] | |
keys = [ndb.Key(models.SlideDeck, id) for id in ids] | |
decks = ndb.get_multi(keys) | |
for deck in decks: | |
if deck is None: continue | |
print deck.deck_id, deck.deck_url |
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 models | |
import json | |
from lib.utils import DateTimeJSONEncoder | |
# Original deck in use, in production: | |
deckA = models.SlideDeck.get_by_id("2cd8f7cf-ca9c-4799-a424-ab9cbe454695") | |
# Reconverted deck, unused: | |
deckB = models.SlideDeck.get_by_id("d72a7645-256c-4d05-9574-22b88d6b9785") | |
#print json.dumps(deckA.to_dict(), indent=2, cls=DateTimeJSONEncoder) |
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 models | |
from lib.utils import AsyncBatchUpdateManager | |
from lib.utils import QueryBatchIterator | |
session = models.DBSession.get_by_key_name("4c80b95e-5554-4dfb-8807-839d7851ab36") | |
print session.is_versioned | |
print "" | |
tles = models.TimelineEvent.query_unversioned(session) |
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
from google.appengine.ext import ndb | |
from models import models | |
key = ndb.Key(models.KnownKaplanEmployee, "[email protected]") | |
models.KnownKaplanEmployee(key=key).put() |
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 lib.session | |
opaque_id = "620-test-1" | |
a = lib.session.get_asset(opaque_id, "slidedecks") | |
print a.asset | |
# lib.session.save_asset(opaque_id, "slidedecks", {"deck_ids":["e7eb7111-30f7-4468-a334-4b87a7ac012a"]}) | |
a = lib.session.get_asset(opaque_id, "slidedecks") |
NewerOlder