mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
[1.11.x] Fixed #28418 -- Fixed queryset crash when using a GenericRelation to a proxy model.
Backport of f9e5f9ae9f from master
This commit is contained in:
@@ -21,10 +21,16 @@ class Link(models.Model):
|
||||
return "Link to %s id=%s" % (self.content_type, self.object_id)
|
||||
|
||||
|
||||
class LinkProxy(Link):
|
||||
class Meta:
|
||||
proxy = True
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Place(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
links = GenericRelation(Link)
|
||||
link_proxy = GenericRelation(LinkProxy)
|
||||
|
||||
def __str__(self):
|
||||
return "Place: %s" % self.name
|
||||
|
||||
Reference in New Issue
Block a user