summaryrefslogtreecommitdiff
path: root/tests/ordering/models.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2015-04-19 02:06:17 -0400
committerSimon Charette <charette.s@gmail.com>2015-04-20 15:49:58 -0400
commitb44ed404c78e93e6afea0b011eead327e65fbd2f (patch)
tree74af8ab0c6957819fde21706a0ead693e53cfcd4 /tests/ordering/models.py
parentffe83d16bd0abfa58e4448cf9d48b52cc43544e9 (diff)
downloaddjango-b44ed404c78e93e6afea0b011eead327e65fbd2f.tar.gz
Fixed #24654 -- Based ordering circular references detection on columns.
Thanks to Elmar Bucher for the report and Tim for the review.
Diffstat (limited to 'tests/ordering/models.py')
-rw-r--r--tests/ordering/models.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ordering/models.py b/tests/ordering/models.py
index 57a75027f6..c588a4e418 100644
--- a/tests/ordering/models.py
+++ b/tests/ordering/models.py
@@ -25,6 +25,7 @@ class Author(models.Model):
@python_2_unicode_compatible
class Article(models.Model):
author = models.ForeignKey(Author, null=True)
+ second_author = models.ForeignKey(Author, null=True)
headline = models.CharField(max_length=100)
pub_date = models.DateTimeField()
@@ -33,3 +34,16 @@ class Article(models.Model):
def __str__(self):
return self.headline
+
+
+class OrderedByAuthorArticle(Article):
+ class Meta:
+ proxy = True
+ ordering = ('author', 'second_author')
+
+
+class Reference(models.Model):
+ article = models.ForeignKey(OrderedByAuthorArticle)
+
+ class Meta:
+ ordering = ('article',)