5👍
✅
I am no Django expert, but try replacing
EmployeeDetails(userName,designation,employeeID,contactNumber,project,dateOfJoin).save()
with
EmployeeDetails(userName=userName,designation=designation,employeeID=employeeID,contactNumber=contactNumber,project=project,dateOfJoin=dateOfJoin).save()
👤NPE
7👍
Don’t use positional arguments, use keywords to specify which field is being populated with what data.
EmployeeDetails(userName=userName, designation=designation) #etc
Also, if you are going to call save()
anyways, you can use EmployeeDetails.objects.create(...)
- [Django]-Monitoring django postgres connections
- [Django]-Cumulative (running) sum of field Django and MySQL
- [Django]-Spam proof hit counter in Django
- [Django]-Caught TypeError while rendering: 'BoundField' object is not iterable
Source:stackexchange.com