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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user