Skip to content
apps/user/models.py
python
from django.db import models
from django.utils import timezone


class UserModel(models.Model):
    username = models.CharField(max_length=64, unique=True)
    password = models.CharField(max_length=128)
    email = models.EmailField(blank=True)
    is_active = models.BooleanField(default=True)
    created_at = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = 'sys_user'

    def __str__(self):
        return self.username

欢迎来到 Laazua 的站点