Created
February 5, 2014 05:10
-
-
Save prog-mitsu/8817720 to your computer and use it in GitHub Desktop.
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
# get_or_insert例 | |
key_name = '01234567' | |
obj = Book.get_or_insert(key_name) | |
if obj.title: | |
# 既に指定keyのエンティティが存在する場合 | |
else | |
# まだ指定keyのエンティティが存在しなかった場合 | |
obj.title = 'The Grapes of Wrath' | |
obj.put() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment