mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #12252 -- Ensure that queryset unions are commutative. Thanks to benreynwar for the report, and draft patch, and to Karen and Ramiro for the review eyeballs and patch updates.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -294,3 +294,26 @@ class Node(models.Model):
|
||||
|
||||
def __unicode__(self):
|
||||
return u"%s" % self.num
|
||||
|
||||
# Bug #12252
|
||||
class ObjectA(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
class ObjectB(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
objecta = models.ForeignKey(ObjectA)
|
||||
number = models.PositiveSmallIntegerField()
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
class ObjectC(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
objecta = models.ForeignKey(ObjectA)
|
||||
objectb = models.ForeignKey(ObjectB)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
Reference in New Issue
Block a user