Browse Source

修改获取国家列表旧接口

peng 2 years ago
parent
commit
21662dd9ea
2 changed files with 3 additions and 5 deletions
  1. 1 3
      Controller/AWS/KVSController.py
  2. 2 2
      Controller/RegionController.py

+ 1 - 3
Controller/AWS/KVSController.py

@@ -9,8 +9,7 @@ import time
 import uuid
 import datetime
 
-from django.http import HttpResponse, StreamingHttpResponse, FileResponse
-from wsgiref.util import FileWrapper
+from django.http import HttpResponse
 from django.views import View
 
 from Model.models import KVS, Device_User, Device_Info
@@ -57,7 +56,6 @@ class UserRelatedView(View):
     def generate_qr_code(response):
         """
         网页生成二维码
-        @param request_dict: 请求参数
         @param response: 响应对象
         @return: response
         """

+ 2 - 2
Controller/RegionController.py

@@ -276,8 +276,8 @@ class RegionView(View):
                 lang_qs = LanguageModel.objects.filter(lang='en')
 
             lang = lang_qs[0]
-            country_qs = CountryLanguageModel.objects.filter(language_id=lang.id).values('country_name',
-                                                                                         'country__number')
+            country_qs = CountryLanguageModel.objects.filter(language_id=lang.id).annotate(
+                country_number=F('country')).values('country_name', 'country_number')
 
             return response.json(0, list(country_qs))
         else: