-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Datastore update schema #501
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
Conversation
@@ -0,0 +1,29 @@ | |||
import webapp2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imports should be in 3 sections - standard library, third-party, and (optionally) application/package-local names
This should be:
import os
import time
import jinja2
import webapp2
import update_schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@ryanmats finished first round, let me know when you're ready for the next round. |
from google.appengine.ext import deferred | ||
from google.appengine.ext import ndb | ||
|
||
import models_v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imports should be in alphabetical order, so v1 should be imported before v2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…oudPlatform/python-docs-samples into datastore-update-schema
|
||
class AddEntitiesHandler(webapp2.RequestHandler): | ||
def post(self): | ||
reload(models_v1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment describing what this does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
self.response.write(template.render(template_values)) | ||
|
||
app = webapp2.WSGIApplication( | ||
[('/display_entities', DisplayEntitiesHandler), ]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close, but you can change this indent to just four spaces, e.g.:
app = webapp.WSGIApplication(
[(....
Change-Id: I2b1f2299364ce8e5caf7894046916cc2a6140719
Change-Id: I932cf3076c9009c2439d0591b1967bf2fd1fd34c
update_schema_task, cursor=query.cursor(), num_updated=num_updated) | ||
else: | ||
logging.debug( | ||
'UpdateSchema complete with {0} updates!'.format(num_updated)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead and change this string to 'update_schema_task complete with {} updates.'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Change-Id: Id5f70ef3e01b44d5ec44649d467d072b3541e850
Change-Id: I0c0e982bcf6243ec096348423128c17da2ced250
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Hi Jon - see this pull request for my current code for the database update schema sample.
I seem to be having a problem where adding a second Picture class with more attributes and querying does not seem to change the database schema. However, when I manually update the original Picture class and add the two attributes, then query, it seems to update.