Skip to content

Instantly share code, notes, and snippets.

@etimesg
Created April 10, 2013 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etimesg/5355307 to your computer and use it in GitHub Desktop.
Save etimesg/5355307 to your computer and use it in GitHub Desktop.
from google.appengine.ext import ndb
from random import randint
from time import sleep
class State(ndb.Model):
name = ndb.StringProperty()
cities = ndb.KeyProperty(repeated=True)
fake_state_name = str(randint(3,1000))
fake_state = State(name=fake_state_name)
fake_state.put()
print fake_state
sleep(1)
fake_state_fetch = State.query(State.name==fake_state_name).fetch(1)
print fake_state_fetch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment