瀏覽代碼

修改获取喂养要点接口

locky 4 月之前
父節點
當前提交
b457613c97
共有 2 個文件被更改,包括 1 次插入4 次删除
  1. 1 3
      Roomumy/Controller/BabyController.py
  2. 0 1
      Roomumy/models.py

+ 1 - 3
Roomumy/Controller/BabyController.py

@@ -190,14 +190,13 @@ class BabyView(View):
         try:
             if not month:
                 return response.json(444)
-            developmental_points_qs = DevelopmentalPoints.objects.filter(month).values()
+            developmental_points_qs = DevelopmentalPoints.objects.filter(month=month).values()
             if not developmental_points_qs.exists():
                 return response.json(173)
             title = developmental_points_qs[0]['title']
             weight = developmental_points_qs[0]['weight']
             height = developmental_points_qs[0]['height']
             head_circumference = developmental_points_qs[0]['head_circumference']
-            advice = developmental_points_qs[0]['advice']
             content = developmental_points_qs[0]['content']
 
             res = {
@@ -205,7 +204,6 @@ class BabyView(View):
                 'weight': weight,
                 'height': height,
                 'head_circumference': head_circumference,
-                'advice': advice,
                 'content': content
             }
             return response.json(0, res)

+ 0 - 1
Roomumy/models.py

@@ -149,7 +149,6 @@ class DevelopmentalPoints(models.Model):
     weight = models.CharField(default='', max_length=32, verbose_name='体重')
     height = models.CharField(default='', max_length=32, verbose_name='身高')
     head_circumference = models.CharField(default='', max_length=32, verbose_name='头围')
-    advice = models.CharField(default='',  max_length=32, verbose_name='早教建议')
     content = models.TextField(default='', verbose_name='内容')
 
     class Meta: