当我尝试将值放入数据库时,出现此错误。
提高TypeError(“%s()获得了意外的关键字参数'%s'”%(cls。名称,kwarg)) TypeError:Employee()获得了意外的关键字参数'EmployeeID'
代码如下:
class Employee (models.Model):
EmployeeID = models.IntegerField
EmployeeFirstName = models.CharField(max_length=100)
EmployeeLastName = models.CharField(max_length=100)
EmployeeEmail = models.CharField(max_length=100)
EmployeeMobileNumber = models.IntegerField
EmployeeHireDate = models.DateField
EmployeeType = models.CharField(max_length=50)
答案 0 :(得分:1)
尝试放置EmployeeID = models.IntegerField()
而不是EmployeeID = models.IntegerField
。