标签:mode display bsp integer models field int ice class
class UserType(models.Model):
user_type_choices = (
(1,‘a‘)
(2,‘b‘)
)
user = models.IntegerField(choices=user_type_choices)
显示的时候可以使用 get_user_display()
标签:mode display bsp integer models field int ice class
原文地址:http://www.cnblogs.com/yixinbuluan/p/7608271.html