Opened 8 years ago

Closed 8 years ago

#4828 closed (invalid)

Error in tutorial

Reported by: anonymous Owned by: jacob
Component: Documentation Version: master
Severity: Keywords: tutorial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In the tutorial, I have read the following text:
Finally, note a relationship is defined, using models.ForeignKey. That tells Django each Choice is related to a single Poll.
However, there is no "models.ForeignKey" in the code:

from django.db import models

class Poll(models.Model):
    question = models.CharField(maxlength=200)
    pub_date = models.DateTimeField('date published')

class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice = models.CharField(maxlength=200)
    votes = models.IntegerField()

Change History (1)

comment:1 Changed 8 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The poll attribute on the Choice model is a ForeignKey.

Note: See TracTickets for help on using tickets.
Back to Top