Hi,

On GAE,
    .select(orderby=~db.table.id)
is treated as
    .select(orderby=db.table.id)

I think there are 2 parts in gql.py to be patched:

In gql.py:Expression:__or__, the new Expression should be:

        return Expression((self.name if self.type!='id' else ('-
__key__' if self.name.startswith('-') else '__key__')) + '|' +
(other.name if other.type!='id' else ('-__key__' if
other.name.startswith('-') else '__key__')), None, None)


And in gql.py:Set:_select, there is a block:

                if orderby.type == 'id':
                    orders = ['__key__']

that should be changed to:

                if orderby.type == 'id':
                    orders = ['-__key__'] if
orderby.name.startswith('-') else ['__key__']

Reply via email to