コード例 #1
0
ファイル: models_test.py プロジェクト: thutupa/redirv2
  def testInsertWithAccountKey(self):
    TEST_USER_ID = 'testUserId'
    accountKey = GetAccountKey(TEST_USER_ID)
    act = Action(parent=accountKey)
    act.keywords = ['a', 'b', 'c']
    act.put()

    self.assertEquals(1, len(Action.query(ancestor=accountKey).fetch(2)))
コード例 #2
0
ファイル: logic.py プロジェクト: thutupa/redirv2
def InsertAction(userId, phrase, link):
    act = Action(parent=GetAccountKey(userId))
    act.keywords = SplitPhrase(phrase)
    act.redirect_link = link
    return act.put()