|
|
@@ -0,0 +1,20 @@
|
|
|
+# coding:utf-8
|
|
|
+
|
|
|
+import os
|
|
|
+import sys
|
|
|
+import importlib
|
|
|
+from django.db.backends.mysql import operations
|
|
|
+
|
|
|
+for p in sys.path:
|
|
|
+ if p.endswith('/'):
|
|
|
+ p = p[:-1]
|
|
|
+ if p.endswith('/site-packages'):
|
|
|
+ file_path = os.path.join(p, 'django/db/backends/mysql/operations.py')
|
|
|
+ with open(file_path, 'r') as fr:
|
|
|
+ content = fr.read()
|
|
|
+ if content.find('query is not None') > -1:
|
|
|
+ content = content.replace('query is not None', 'False')
|
|
|
+ with open(file_path, 'w') as fw:
|
|
|
+ fw.write(content)
|
|
|
+ importlib.reload(operations)
|
|
|
+
|