1. Marat Khabibullin
  2. wtforms

Commits

ss1978  committed 1de6b4e

ReferencePropertyField option's selected flag eval bugfix

  • Participants
  • Parent commits 2904fbf
  • Branches default

Comments (0)

Files changed (1)

File wtforms/ext/appengine/fields.py

View file
 import decimal
-
+import logging
 from wtforms import fields, widgets
 
 class ReferencePropertyField(fields.SelectFieldBase):
         for obj in self.query:
             key = str(obj.key())
             label = self.label_attr and getattr(obj, self.label_attr) or obj
-            yield (key, label, key == self.data)
+            yield (key, label, self.data and ( self.data.key( ) == obj.key() ) )
 
     def process_formdata(self, valuelist):
         if valuelist: