From a181d796df8578d4210803b485d434a043b5a3ba Mon Sep 17 00:00:00 2001 From: CapooL <2053217188@qq.com> Date: Thu, 2 Nov 2023 00:17:51 +0800 Subject: [PATCH] fix(user):delete unnecessary files --- hinghwa-dict-backend/relative/models.py | 10 ---------- hinghwa-dict-backend/user/view/manage.py | 5 +++++ 2 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 hinghwa-dict-backend/relative/models.py diff --git a/hinghwa-dict-backend/relative/models.py b/hinghwa-dict-backend/relative/models.py deleted file mode 100644 index fa4a5c92..00000000 --- a/hinghwa-dict-backend/relative/models.py +++ /dev/null @@ -1,10 +0,0 @@ -from django.db import models - - -class Person(models.Model): - name = models.CharField(blank=True, verbose_name="身份", max_length=100) - - -class Relation(models.Model): - from_person = models.ForeignKey(Person, on_delete=models.CASCADE, verbose_name="本人") - to_person = models.ForeignKey(Person, on_delete=models.CASCADE, verbose_name="他人") \ No newline at end of file diff --git a/hinghwa-dict-backend/user/view/manage.py b/hinghwa-dict-backend/user/view/manage.py index 6bb35087..4655db05 100644 --- a/hinghwa-dict-backend/user/view/manage.py +++ b/hinghwa-dict-backend/user/view/manage.py @@ -59,6 +59,11 @@ def get(self, request, id): "word_uploaded": user.contribute_words.count(), "article_views": user.articles.aggregate(Sum("views"))["views__sum"] or 0, + # TODO 去除播放量相关(需要确认前端全部删除) + "listened": user.contribute_pronunciation.aggregate(Sum("views")).get( + "views__sum" + ) + or 0, }, }