Пример #1
0
class UserInfo(BaseTable):
    class Meta:
        verbose_name = '用户信息'
        db_table = 'UserInfo'

    username = models.CharField('用户名', max_length=20)
    password = models.CharField('密码', max_length=20)
    email = models.EmailField('邮箱')
    status = models.IntegerField('有效/无效', default=1)
    # user_type = models.ForeignKey(UserType, on_delete=models.CASCADE)
    objects = UserInfoManager()
Пример #2
0
class UserInfo(models.Model):
    class Meta:
        db_table = 'UserInfo'

    username = models.CharField(max_length=20)
    password = models.CharField(max_length=20)
    email = models.EmailField()
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)
    status = models.IntegerField(default=1)
    user_type = models.ForeignKey(UserType, on_delete=models.CASCADE)
    objects = UserInfoManager()
Пример #3
0
class UserInfo(BaseTable):
    class Meta:
        verbose_name = '用户信息'
        db_table = 'UserInfo'

    username = models.CharField('用户名', max_length=20, unique=True, null=False)
    password = models.CharField('密码', max_length=20, null=False)
    email = models.EmailField('邮箱', null=False, unique=True)
    status = models.IntegerField('有效/无效', default=1)
    # user_type = models.ForeignKey(UserType, on_delete=models.CASCADE)
    user_type = models.IntegerField('用户类型(0:用户,1:管理员)', default=0)

    objects = UserInfoManager()
Пример #4
0
class UserInfo(BaseTable):
    status_choices = (
        (1, '有效'),
        (2, '无效'),
    )

    username = models.CharField('用户名', max_length=20, unique=True, null=False)
    password = models.CharField('密码', max_length=20, null=False)
    email = models.EmailField('邮箱', null=False, unique=True)
    status = models.IntegerField('有效/无效', default=1, choices=status_choices)
    # user_type = models.ForeignKey(UserType, on_delete=models.CASCADE)
    objects = UserInfoManager()

    class Meta:
        verbose_name = '用户信息'
        db_table = 'UserInfo'