1👍
You should order in descending order, you can do this by prefixing the fieldname with a minus (-
):
def get_all_top_rated_products(self):
return self.filter(is_remove=False).order_by(
'-average_rating', '-total_reviews'
)
Source:stackexchange.com