Opened 17 years ago
Closed 17 years ago
#4828 closed (invalid)
Error in tutorial
Reported by: | anonymous | Owned by: | Jacob |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | tutorial | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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()
Note:
See TracTickets
for help on using tickets.
The poll attribute on the Choice model is a ForeignKey.