Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
RT, when creating model objects, prompt typeerror: save() missing 1 required position argument: ‘self’
Solution: you need to add ()
For example: from. Models import userinfo
usr = userinfo # error
usr = userinfo() # correct
PS: don’t forget to generate and migrate data tables after creating data
This article is shared in the blog “phyger” (cnblog).
Similar Posts:
- [Solved] DjangoORM Run python manage.py makemigrations Error: no changes detected
- Python TypeError: __init__() missing 1 required positional argument: ‘on_delete’
- Django auth.User.groups: (fields.E304) Reverse accessor for User.groups clashes with reverse
- How to Solve Django Error: No such column: xxx
- Django: How to Convert Models object to JSON
- python Warning: OverflowError: Python int too large to convert to C long
- Preservation and recovery of TF. Train. Saver () model of tensorflow
- [Solved] Pycharm Error: TypeError: init() missing 1 required positional argument: ‘on_delete’
- [Solved] Keras loads the model Error: attributeerror: ‘STR’ object has no attribute ‘decode’
- [Solved] django.db.utils.ProgrammingError: (1146, u”Table” xxx doesn’t exist”)