Skip to content

Instantly share code, notes, and snippets.

@dylanvee
Created August 20, 2012 22:10
Show Gist options
  • Save dylanvee/3408404 to your computer and use it in GitHub Desktop.
Save dylanvee/3408404 to your computer and use it in GitHub Desktop.
db/ndb query example
from google.appengine.ext import db, ndb
class OldBananaStand(db.Model):
contains_money = db.BooleanProperty()
class NewBananaStand(ndb.Model):
contains_money = ndb.BooleanProperty()
old_ones = OldBananaStand.all()
old_ones.filter('contains_money = True') # => ok!
new_ones = NewBananaStand.query()
new_ones.filter(NewBananaStand.contains_money == True) # => nope
new_ones = new_ones.filter(NewBananaStand.contains_money == True) # => ok!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment