Hi all,
The following code is part of the djangoproject.com/en/1.9/tutorial part
2 in mysite/polls/models.py
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)
def _str__(self):
return self.choice_text
The last entry (def __str__(self): throws an error "inconsistent dedent
at line .... I can find nothing wrong. I have tried retyping the line
with no results. I'm using Eclipse IDE with PyDev plugin. This is not
just an annoyance. Any attempt to do migrate errors out with the same
error. The code is typed verbatim from the tutorial.
I am at a loss as how to fix this . Please help.
Gary R.
--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/cc6df283-797a-64c3-bf3f-78aac9c80616%40verizon.net.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment