Text of error message in case the image is not loading

>>> q = Question.objects.get(pk=1)
>>> q.choice_set.all()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/lib64/python3.6/site-packages/django/db/models/query.py", line 
251,                                                                        
                                              in __repr__
    return '<%s %r>' % (self.__class__.__name__, data)
  File "/usr/lib64/python3.6/site-packages/django/db/models/base.py", line 
513,                                                                        
                                              in __repr__
    return '<%s: %s>' % (self.__class__.__name__, self)
  File "/home/kkondapalli/mysite/polls/models.py", line 25, in __str__
    return self.question_text
AttributeError: 'Choice' object has no attribute 'question_text'
>>>



On Saturday, 26 May 2018 22:49:04 UTC+5:30, Kranthi Kiran wrote:
>
> Hello User,
>
> I am following django tutorial at 
> https://docs.djangoproject.com/en/2.0/intro/tutorial02/
>
> After modifying polls/models.py  and when running python3.6 manage.py 
> shell again
>
>
> I am getting the following error at the following 
>
> >>> q = Question.objects.get(pk=1)
> # Display any choices from the related object set -- none so far.>>> 
> q.choice_set.all()<QuerySet []>
>
>
> Error screenshot
>
>
>
>
> Please help me to resolve the issue at earliest
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0e27456c-eefa-4a1e-bf4f-a44d9e8dcad1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to