Last active
January 4, 2018 11:31
-
-
Save codephillip/349664f3a761f579ee6b682a152e53e8 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
class TestTable(ndb.Model): | |
fb_page_id = ndb.StringProperty() | |
date = ndb.StringProperty() | |
step = ndb.IntegerProperty() | |
if not isLocal(): | |
from google.appengine.ext import ndb | |
print("started") | |
import random | |
test_page = random.randint(100000000, 99999999999999) | |
sci_key = ndb.Key(TestTable, test_page) | |
sci = sci_key.get() | |
if not sci: | |
sci = TestTable() | |
sci.key = sci_key | |
sci.fb_page_id = str(test_page)[:8] | |
import datetime, time | |
sci.date = str(int(time.mktime(datetime.datetime.now().timetuple()) * 1000)) | |
sci.put() | |
sci_count = TestTable.query().count() | |
items = TestTable.query().fetch() | |
# ndb.delete_multi( | |
# TestTable.query().fetch(keys_only=True) | |
# ) | |
print(sci_count) | |
print(items) | |
print("ended") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment