shot_list增加筛选model_id

FFIB 2 年之前
父節點
當前提交
bdb24bcbd8
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      api/tenancy_admin_views.py

+ 4 - 0
api/tenancy_admin_views.py

@@ -25,10 +25,14 @@ def shot_list(request, administrator):
25 25
     num = request.POST.get('num', 20)
26 26
     tenancy_status = request.POST.get('tenancy_status', '')
27 27
     query = request.POST.get('query', '')
28
+    model_id = request.POST.get('model_id', '')
28 29
 
29 30
     shots = TenancyShotInfo.objects.filter(status=True).order_by('-pk')
30 31
     if tenancy_status != '':
31 32
         shots = shots.filter(tenancy_status=tenancy_status)
33
+    
34
+    if model_id:
35
+        shots = shots.filter(model_id=model_id)
32 36
 
33 37
     if query:
34 38
         shots = shots.filter(Q(sn__icontains=query))