我正在使用Django 2.1.3
,pymysql 0.9.2
,mysql 5.7
,python3.5
sql_mode in mysql:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
db setting in django:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
...,
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
'charset': 'utf8mb4'
},
}
我总是收到这样的警告:
/venv3.5/lib/python3.5/site-packages/pymysql/cursors.py:170: Warning: (3135, "'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.")
result = self._query(query)
/venv3.5/lib/python3.5/site-packages/pymysql/cursors.py:170: Warning: (3090, "Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.")
result = self._query(query)
为什么我会收到上述警告?
任何评论都非常受欢迎。非常感谢。
答案 0 :(得分:1)
尝试:
Loop through `progress` {
if action_1 to action_3 {
Task1.push
}
if action_4 to action_8 {
Task2.push
}
if action_9 to action_11 {
Task3.push
}
}
您还可以看到warnings — Warning control。