📜  Django 自定义用户模型 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:22.400000             🧑  作者: Mango

代码示例5
from django.contrib.auth.models import User

class Employee(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    department = models.CharField(max_length=100)