36
EMP_CHOICES = (
(0,'-- Select --'),
(1,'Good'),
(2,'Average'),
)
class EMPFeedback(models.Model):
user_choices = models.IntegerField(choices=EMP_CHOICES)
如果存储在数据库为1 user_choices价值如何打印相应user_choices相应的值(即1个== GOOD)Django的打印选择价值
fb = EMPFeedback.objects.get(id=1)
print fb.user_choices # prints 1
print fb.user_choices.EMP_CHOICES
============谢谢============ – Rajeev 2010-11-25 06:19:57