你必须在 models.py 中创建两个类class Sales(models.model): user = models.ForiegnKey(User , on_delete= models.CASCADE) { add more attributes if u want } class Employee(models.model): user = models.ForiegnKey(User , on_delete= models.CASCADE) { add more attributes if u want }之后创建一个名为 forms.py 的新文件 class SalesForm(forms.Modelform): class Meta: model = Sales fields = [ 'u can insert the fields which u want to show in ur form ' ]同样,您为您的员工制作表单类NOTE:--u have to import ur model in your form.py moduleand do import--- from django.contrib.auth.models import User in ur models.py file