Skip to content

Instantly share code, notes, and snippets.

@jdunne-kaplan
Created March 12, 2015 18:28
Show Gist options
  • Save jdunne-kaplan/6d529582142ab227391d to your computer and use it in GitHub Desktop.
Save jdunne-kaplan/6d529582142ab227391d to your computer and use it in GitHub Desktop.
Update deck_url of deckA with deckB's
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)
#print ""
#print json.dumps(deckB.to_dict(), indent=2, cls=DateTimeJSONEncoder)
deckA.old_deck_url = deckA.deck_url
deckA.deck_url = deckB.deck_url
deckA.modified_at = deckB.modified_at
print json.dumps(deckA.to_dict(), indent=2, cls=DateTimeJSONEncoder)
deckA.put()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment