Ticket #5680: models-mysql-duplicated-index-and-foreign-constraints.py
File models-mysql-duplicated-index-and-foreign-constraints.py, 434 bytes (added by , 16 years ago) |
---|
Line | |
---|---|
1 | from django.db import models |
2 | |
3 | class Poll(models.Model): |
4 | question = models.CharField(max_length=200) |
5 | pub_date = models.DateTimeField('date published') |
6 | def __unicode__(self): |
7 | return self.question |
8 | |
9 | class Choice(models.Model): |
10 | poll = models.ForeignKey(Poll) |
11 | choice = models.CharField(max_length=200) |
12 | votes = models.IntegerField() |
13 | def __unicode__(self): |
14 | return self.choice |