示例:
模型定义
class msg(models.Model): choice = ( (1, '技术部'), (2, '行政'), (3, '人事'), (4, "财务"), ) group = models.IntegerField(choices=choice)
想要获取元组的值,则使用下面的方法
get_group_display()标签:group,get,models,DjangoORM,choices,字段,display From: https://www.cnblogs.com/Durant0420/p/17539657.html