Hack to fix behavior of order_by and count()

* To fix django pagination