I have the following model:
class Product(ndb.Model):
name = ndb.StringProperty()
bidTime = ndb.DateTimeProperty()
price = ndb.IntegerProperty()
...
I'd likd to use the following query:
productRanks = Product.query(Product.bidTime>=startDate,
Product.bidTime<endDate).order(-Product.price).fetch()
where startDate and endDate are datetime objects. But I got the following error message:
The first sort property must be the same as the property to which the inequality filter is applied
If I add Product.bidTime in the order then there will be no error:
.order(Product.bidTime, -Product.price)
However, the sorted result would be wrong (according to date, not price). So, what is the problem?