trending

Deciding and implementing a trending algorithm in Django

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 02:58:10
问题 I have a Django application in which I need to implement a simple trending/ranking algorithm. I'm very lost as a : I have two models, Book and Reader . Every night, new books are added to my database. The number of readers for each book are updated too every night i.e. One book will have multiple reader statistic records (one record for each day). Over a given period (past week, past month or past year), I would like to list the most popular books, what algorithm should I use for this? The