Skip to content

Instantly share code, notes, and snippets.

@ankona
Created October 30, 2014 14:54
Show Gist options
  • Save ankona/ba350040ad40e3d962eb to your computer and use it in GitHub Desktop.
Save ankona/ba350040ad40e3d962eb to your computer and use it in GitHub Desktop.
update DBSession to comply with fields newly configured as required
from google.appengine.ext import db
from datetime import datetime
# local override with start not being required
class DBSession(db.Model):
start = db.DateTimeProperty()
title = db.StringProperty()
for s in DBSession.all():
save_it = False
if not s.start:
save_it = True
s.start = datetime(2014, 1, 1)
if not s.title:
save_it = True
s.title = 'space-holder-title'
if save_it:
s.put()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment