Appengine filter inequality and ordering fails

前端 未结 5 1571
悲哀的现实
悲哀的现实 2021-02-01 18:03

I think I\'m overlooking something simple here, I can\'t imagine this is impossible to do.

I want to filter by a datetime attribute and then order the result by a rankin

5条回答
  •  孤城傲影
    2021-02-01 18:42

    The datastore isn't capable of ordering a query that contains an inequality by any property other than the one used in the inequality.

    This can often be worked around by adding a property that can be filtered with an equality; in this case, it may be possible to have a BooleanProperty tracking whether an entity is from the current week, and update it for all entities at the end of each week.

提交回复
热议问题