How do i sort a query by a ListProperty*?
the Model:
class Chapter(ndb.Model):
title = ndb.StringProperty(required=True)
version = ndb.IntegerProperty(repeated=True)
the 'version' stores values like:
1.1 -> [1,1]
1 -> [1]
2.1.1.1.1 -> [2,1,1,1,1]
1.2 -> [1,2]
2.1.2 -> [2,1,2]
I want to order it like:
1
1.1
1.2
2.1.1.1.1
2.1.2
*Im using NDB so, ListProperty = ndb.IntegerProperty(repeated=True)
That's not how listproperties work, unfortunately. For an ascending-order query, the value used will be the smallest in the list. You'll have to store the values differently (as a string, for example) to do what you're asking.
OMG I finally did it.
So simple... and yet so much time to find it...