一 小知识点回顾

#orm
class UserInfo (models.Model):
    id = models.AutoField (primary_key=True)
    name = models.CharField (max_length=32)
    pwd = models.CharField (max_length=32)
    choices = ((0, '普通用户'), (1, 'vip用户'), (2, '年费vip'))
    user_type = models.IntegerField (choices=choices, default=0)
#view
   获取汉字
   request.user.get_user_type_display()
choices

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-12-16
  • 2022-12-23
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2021-12-02
  • 2021-11-22
相关资源
相似解决方案