django - 我正在尝试使用文本选择,但收到此错误 - python 'appstat' 无法转换为 MySQL 类型”,无
问题描述
我收到此错误:
django.db.utils.ProgrammingError:(-1, "Failed processing format-parameters; P)
这是错误所在的models.py:
class Person(models.Model):
class AppStat(models.TextChoices):
Submitted = 'SUB', ('Submitted')
HRREV = 'HR', ('HR Reviewed')
Contacted = 'CON', ('Contacted')
Accepted = 'AC', ('Accepted')
Rejected= 'REJ', ('Rejected')
它在本地环境中运行良好,但是当我使用 mysql 连接器移动到 docker 容器中的环境时,它就不行了。
Exception Value:
(-1, "Failed processing format-parameters; Python 'appstat' cannot be converted to a MySQL type", None)
解决方案
推荐阅读
- python - 只有在熊猫数据框中以数字开头时才添加前导零
- python - pandas to csv - 保留“$”作为格式
- asp.net-mvc-4 - 如何通过网格刷新读取和更新剑道网格页脚模板值
- java - 从我自己的 Android 应用程序单击我的 Google 地图活动中的标记时打开浏览器 url
- django - 如何在 djando 模型中对某些对象使用 on_delete CASCADE,对其他对象使用 ondelete DO_NOTHING
- java - 我的 java 程序为某些 AWT 类抛出 java.lang.ClassNotFoundException 我该怎么办?
- c# - 如何计算 PostgreSQL 中 BEGIN TRANSACTION 语句的数量?
- google-cloud-platform - BigQuery 查询在执行期间试图通过错误的帐户
- python - Andrew Ng 的猫与非猫示例的 Tensorflow 实现 (coursera)
- python - 更改图像的调色板