Reverse the Sort Orders on an NDB Query

A quick, not-well-documented hack for Google App Engine fans.

Julian Diaz
Brain Hacking at workZeit

--

To flip the order around on an existing NDB query, try this:

my_query._Query__orders = my_query.orders.reversed()

Great for when you’re using reversed query cursors.

--

--

Julian Diaz
Brain Hacking at workZeit

Partner, lead developer, and mind-hacker extraordinaire for workZeit.