Parcourir la source

markscore avg

xjc il y a 4 mois
Parent
commit
cba6814552
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/weixin/controls.py

+ 2 - 1
src/weixin/controls.py

@@ -3769,7 +3769,8 @@ def get_user_markscore_week_avg(request):
     msret = msret.values("stock_date").distinct()
     for item in msret:
         qset = cm.UserMarkScore.objects.filter(stock_date=item['stock_date']).aggregate(avg_score=Avg("score"))
-        data.append({"stock_date":item['stock_date'],"avg_score":qset.get("avg_score",0)})
+        avg_score = "{}".format(round(qset.get("avg_score",0),1))
+        data.append({"stock_date":item['stock_date'],"avg_score":avg_score})
     # for i in range(1,5):
     #     item_list = []
     #     for j in range(1,8):