Sorting the request with ListProperty (NDB)
How do I sort the request using ListProperty *?
Model:
class Chapter(ndb.Model):
title = ndb.StringProperty(required=True)
version = ndb.IntegerProperty(repeated=True)
"version" stores values ββsuch as:
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 this:
1
1.1
1.2
2.1.1.1.1
2.1.2
* Im using NDB, so ListProperty = ndb.IntegerProperty (repeat = True)
+3
source to share
2 answers