On May 21, 2:51 pm, nobody <[EMAIL PROTECTED]> wrote:
> I'm going through the "Writing your first Django app" tutorial on
> djangoproject.com but I'm not getting very far, unfortunately.

ok

> >>> p = Poll.objects.get(pk=1)
> >>> p.choice_set.create(choice='Not much', votes=0)
>
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
>   File "C:\Python25\lib\site-packages\django\db\models\base.py", line
> 241, in __repr__
>     return smart_str(u'<%s: %s>' % (self.__class__.__name__,
> unicode(self)))
>   File "C:\Python25\Lib\site-packages\django\testproject\..\testproject
> \polls\models.py", line 19, in __unicod
> e__
>     return self.question
> AttributeError: 'Choice' object has no attribute 'question'

If you look at the Traceback, you will see that there is a problem
with line 19 in models.py, which is helpfully printed out:

return self.question

Choice doesn't have an attribute called question, as described in the
error. Perhaps another model in the same file has an attribute called
question and you simply copied the code in the wrong place?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to