mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #13241. order_with_respect_to now works with ForeignKeys who refer to their model lazily (i.e. with a string). Thanks to Gabriel Grant for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -17,3 +17,13 @@ class Answer(models.Model):
|
||||
|
||||
def __unicode__(self):
|
||||
return unicode(self.text)
|
||||
|
||||
class Post(models.Model):
|
||||
title = models.CharField(max_length=200)
|
||||
parent = models.ForeignKey("self", related_name="children", null=True)
|
||||
|
||||
class Meta:
|
||||
order_with_respect_to = "parent"
|
||||
|
||||
def __unicode__(self):
|
||||
return self.title
|
||||
|
||||
Reference in New Issue
Block a user