Commits

Anonymous committed 47f970b

fix: Appengine/ReferencePropertyField sometimes used key, sometimes used Property as data. Now using the "Referenced Property" as data.

  • Participants
  • Parent commits 1de6b4e

Comments (0)

Files changed (1)

wtforms/ext/appengine/fields.py

         if self._formdata is not None:
             for obj in self.query:
                 if str(obj.key()) == self._formdata:
-                    self._set_data(obj.key())
+                    self._set_data(obj)
                     break
         return self._data
 
     def pre_validate(self, form):
         if not self.allow_blank or self.data is not None:
             for obj in self.query:
-                if str(self.data) == str(obj.key()):
+                if str(self.data.key()) == str(obj.key()):
                     break
             else:
                 raise ValueError(self.gettext(u'Not a valid choice'))