I have model which looks like this:
class Example (db.Model) :
name = db.StringProperty()
tags = db.StringListProperty()
I first query for a tag to get the list of entities which have them:
results = Example.all().filter("tags =", tagSearch).fetch(100)
This gives me a list of entities containing the "tagSearch" in their "tags" list.
Here is how a sample of the result entities would look like:
entityA = [tagSearch, m, n, o, ....]
entityB = [a, b, c, tagSearch, ... ]
entityC = [a, tagSearch, a, ,a ,x ....... ....]
I want to sort all the entities in the result set based on the position of the item tagSearch in them, in descending order.
basically - entityA, entityC, entityB
How do I do this? note I am running this on appengine ...
also assumption given than tagSearch will occur only once in any list.
Any help will be highly appreciated.