1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.5.x] Fixed #19607 - prefetch_related crash

Thanks to av@rdf.ru and flarno11@yahoo.de for the report.

Backport of 4fd94969d8 from master
This commit is contained in:
Luke Plant
2013-05-24 10:01:34 +01:00
committed by Tim Graham
parent 9356495936
commit 00b39e0145
3 changed files with 51 additions and 3 deletions

View File

@@ -195,3 +195,23 @@ class Employee(models.Model):
class Meta:
ordering = ['id']
### Ticket 19607
@python_2_unicode_compatible
class LessonEntry(models.Model):
name1 = models.CharField(max_length=200)
name2 = models.CharField(max_length=200)
def __str__(self):
return "%s %s" % (self.name1, self.name2)
@python_2_unicode_compatible
class WordEntry(models.Model):
lesson_entry = models.ForeignKey(LessonEntry)
name = models.CharField(max_length=200)
def __str__(self):
return "%s (%s)" % (self.name, self.id)