Created
September 19, 2013 22:38
-
-
Save otger/6630838 to your computer and use it in GitHub Desktop.
NDB StructuredProperty example
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 ProviderNDB(ndb.Model): | |
name = ndb.StringProperty() ##Published name | |
enabled = ndb.BooleanProperty(default = True) | |
last_crawl = ndb.DateTimeProperty(auto_now_add=True) | |
p = ProviderNDB(id='test', name='provider test') | |
p.put() | |
class testNDB(ndb.Model): | |
provider = ndb.StructuredProperty(ProviderNDB) | |
town = ndb.StringProperty() | |
t = testNDB(id='test', provider = p, town='whatever') | |
t.put() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment