from django.db import models
# Create your models here.
class UserInfo(models.Model):
"""
员工
"""
nid = models.BigAutoField(primary_key=True)
user = models.CharField(max_length=32)
password = models.CharField(max_length=64)
age = models.IntegerField(default=0)
ug = models.ForeignKey('UserGroup',null=True,on_delete=models.CASCADE)
class UserGroup(models.Model):
"""
部门
"""
title = models.CharField(max_length=32)
fo = models.ForeignKey('Foo',on_delete=models.CASCADE,null=True)
class Foo(models.Model):
caption = models.CharField(max_length=16)