シンガポールでは、Singpath ( singpath.appspot.com )を使用して学生に Python を教えています。学生に Python でソフトウェアを書く練習をさせることに加えて、ビッグ テーブルにアクセスするために使用される google.appengine.ext.db API に学生を慣れさせたいと考えています。
App Engine アプリで db.Model 設定を変更して、大きなテーブルに書き込むのではなく、ローカルの一時データストアに書き込みまたはアクセスできるようにする最も簡単な方法は何ですか? 単体テストが実行されるたびにgaeunitが新しい一時データストアを作成する方法と同様のことをしようとしています。
from google.appengine.ext import db
import logging
class MyModel(db.Model):
name = db.StringProperty()
#Configure a temp datastore to be updated instead of bigtable.
m = MyModel()
m.put() #shouldn't update bigtable
result = MyModel.all() #should fetch from temp datastore
logging.info("There were %s models saved", result.count())