Skip to content Skip to sidebar Skip to footer

Ndb Ordering By Property Of Structuredproperty

Say I have an ndb.Model class that I want to use as a StructuredProperty on another model class: class CommonExtraData(ndb.Model): count = ndb.IntegerProperty(required=True) c

Solution 1:

Just did a bit of experimentation and it appears to be working. You should be able to do it exact as you wrote out.

In experimenting, I found one quirk that should be noted - if you use repeated property, it appears to sort on the first instance of the repeated property only. For example, if your repeated property had [CommonExtraData(count=5), CommonExtraData(count=1)] and another had [CommonExtraData(count=7), CommonExtraData(count=2)], it would sort like this:

[CommonExtraData(count=7), CommonExtraData(count=2)] [CommonExtraData(count=5), CommonExtraData(count=1)]

Post a Comment for "Ndb Ordering By Property Of Structuredproperty"