O'Reilly logo

Mastering Google App Engine by Mohsin Shafique Hijazee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sorting

Now we are comfortable with querying the data, it is time to put it in some desirable order. That is, sorting the results. How do we do that? Our old friend search.QueryOptions takes a keyword argument called sort_options. We just have to supply that and we are done. Okay, so the question is what this sort_options argument would be?

It's actually an instance of search.SortOptions class which takes a single argument called expressions. What is expressions then? It is just a list of search.SortExpression instances where search.SortExpression constructor takes some keyword arguments which define the sorting behavior.

All this seems bit complicated so let's take another look.

  • Whenever you are going to sort, you are either going to sort on a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required