Skip to content

Datastore update schema tags 3 #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
2 changes: 2 additions & 0 deletions appengine/standard/ndb/schema_update/models_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from google.appengine.ext import ndb


# [START: models_v1]
class Picture(ndb.Model):
author = ndb.StringProperty()
name = ndb.StringProperty(default='')
# [END: models_v1]
2 changes: 2 additions & 0 deletions appengine/standard/ndb/schema_update/models_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
from google.appengine.ext import ndb


# [START: models_v2]
class Picture(ndb.Model):
author = ndb.StringProperty()
name = ndb.StringProperty(default='')
# Two new fields
num_votes = ndb.IntegerProperty(default=0)
avg_rating = ndb.FloatProperty(default=0)
# [END: models_v2]