Bladeren bron

修复删除

chenjunkai 6 jaren geleden
bovenliggende
commit
563984486b
2 gewijzigde bestanden met toevoegingen van 17 en 24 verwijderingen
  1. 14 21
      Ansjer/test/util/spnsss.py
  2. 3 3
      Controller/VodBucket.py

+ 14 - 21
Ansjer/test/util/spnsss.py

@@ -1,22 +1,15 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-  
-"""
-@Copyright (C) ansjer cop Video Technology Co.,Ltd.All rights reserved.
-@AUTHOR: ASJRD018
-@NAME: AnsjerFormal
-@software: PyCharm
-@DATE: 2019/1/3 16:46
-@Version: python3.6
-@MODIFY DECORD:ansjer dev
-@file: spnsss.py
-@Contact: chanjunkai@163.com
-"""
 import time
 import time
-daytime= '2019012117'
-timeArray = time.strptime(daytime, "%Y%m%d%H %z")
-# daytime= '2019012117'
-# timeArray = time.strptime(daytime, "%Y%m%d%H")
-print(timeArray)
-startTime = time.mktime(timeArray)
-print(startTime)
-# 1548061200
+
+
+# a+b+c=1000,且 a2+b2=c^2
+start_time = time.time()
+print(start_time)
+for a in range(0, 1001):
+    for b in range(0, 1001):
+        c = 1000-a-b
+        if a ** 2 + b ** 2 == c ** 2:
+            print("a,b,c:%d,%d,%d" % (a, b, c))
+
+end_time = time.time()
+print("elapsed:%f" % (end_time-start_time))
+print("complete")

+ 3 - 3
Controller/VodBucket.py

@@ -221,9 +221,9 @@ class UidBucketView(View):
         try:
         try:
             page = int(request_dict.get('page', None))
             page = int(request_dict.get('page', None))
             line = int(request_dict.get('line', None))
             line = int(request_dict.get('line', None))
-            d_ubqs = UID_Bucket.objects.filter(id=id).values('uid', 'channel')
-            uid = d_ubqs[0]['uid']
-            channel = d_ubqs[0]['uid']
+            d_ubqs = UID_Bucket.objects.filter(id=id)
+            uid = d_ubqs[0].uid
+            channel = d_ubqs[0].uid
             d_ubqs.delete()
             d_ubqs.delete()
             OssCrdModel.objects.filter(uid=uid, channel=channel).delete()
             OssCrdModel.objects.filter(uid=uid, channel=channel).delete()
         except Exception as e:
         except Exception as e: