Monday, July 2, 2012

Unable to obtain c.poll

Hi Djangoers,

I am almost completing my first tutorial but got stuck at the last point. So I am assigning Choice object to 'c',

c = p.choice_set.filter(choice_text__startswith='Just')

And I am getting this output when I check 'c'

[<Choice: Just Hacking again>]

And I am also getting the right output for 'p'

<Poll: WASSUP!!!!>

But when I am executing,

     c.poll

This is my output,

Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'QuerySet' object has no attribute 'poll'

Not sure where I am going wrong?

--
Thanks & Regards
Smaran Harihar

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment