Had the problem described and solved here:
Suggest to change model.py line 227 and next as follows:
# Only filter for non-null values...
if current_value is not None:
# ...and not empty arrays in case of properties with repeated=True
self._AddFilter(prop == current_value)
Didn't see how to create a pull request: sorry if this is not the correct way to contribute this suggestion and thanks for the great library!
A couple questions on this:
First, the latest version of model.py has a check just above the if current_value is not None (lines 231-234):
if current_value is not None
if current_value != :
raise ValueError('No queries on repeated values are allowed.')
Wouldn't this already catch the repeated field and prevent the problem you're talking about? Are you using an older version of the library?
And also, could something like this be used change to your Contacts class/model to change the empty list to be None instead (I haven't tested this)?
return ndb.get_multi(self.email_keys) or None
I actually fixed this for a talk but it never made it in:
Also had another fix in that fork:
Sorry for getting back so late.
@kdeus is right: I had an older version of the library and the latest version fixes the issue. Also, I haven't tried your proposed solution in my Contacts model but it might work well too.
Thanks to both @kdeus and @dhermes for your feedback.