please help

20 views
Skip to first unread message

danbmathew

unread,
Jun 15, 2017, 1:34:35 PM6/15/17
to Django users
I am strictly following the documentation but on this code, q.choice_set.create(choice_text='Not much', votes=0) on almost at the bottom of Playing With API section of the documentation, I got the following error.

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\fields\related_descriptors.py", line 653, in create
    return super(RelatedManager, self.db_manager(db)).create(**kwargs)
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\query.py", line 392, in create
    obj = self.model(**kwargs)
  File "C:\Users\DELL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\base.py", line 571, in __init__
    raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
TypeError: 'choice_text' is an invalid keyword argument for this function

Please Help.
Reply all
Reply to author
Forward
0 new messages