Hi brendan,

You have the import class before using, so

from polls.models import Poll

2012/10/25 Brendan Carroll <btk...@gmail.com>

> Hi all
> I am new to Django and I'm having an issue with some code. I am trying to
> get through the first tutorial from the Django site.
> I have a file called polls/models.py and have created a class that
> contains the following code
> class Poll(models.Model):
>      question = models.CharField(max_length=200)
>      pub_date = models.DateTimeField('date published')
>
> The problem occurs when I go into the command prompt and enter the
> following line
> p = Poll(question = "Whats new? ", pub_date=timezone.now())
> The error is as follows: name Poll is not defined.
> Appreciate any help guidance
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/dBbvVPL8BicJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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

Reply via email to