This seemingly perfect Google App Engine code fails with a KindError.
# in a django project 'stars'
from google.appengine.ext import db
class User(db.Model):
pass
class Picture(db.Model):
user = db.ReferenceProperty(User)
user = User()
user.put()
picture = Picture()
picture.user = user
# ===> KindError: Property user must be an instance of stars_user
The exception is raised in google.appengine.ext.db.ReferenceProperty.validate:
def validate(self, value):
...
if value is not None and not isinstance(value, self.reference_class):
raise KindError('Property %s must be an instance of %s' %
(self.name, self.reference_class.kind()))
...