mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #24156 -- Fixed inherited related name of ManyToManyField.
Fixed situation when parent abstract model declares related_name='+', and child models had an invalid queryset.
This commit is contained in:
committed by
Tim Graham
parent
ec74dba2ab
commit
f7b2978158
@@ -35,3 +35,20 @@ class Article(models.Model):
|
||||
|
||||
class Meta:
|
||||
ordering = ('headline',)
|
||||
|
||||
|
||||
# Models to test correct related_name inheritance
|
||||
class AbstractArticle(models.Model):
|
||||
class Meta:
|
||||
abstract = True
|
||||
ordering = ('title',)
|
||||
|
||||
publications = models.ManyToManyField(Publication, name='publications', related_name='+')
|
||||
|
||||
|
||||
class InheritedArticleA(AbstractArticle):
|
||||
pass
|
||||
|
||||
|
||||
class InheritedArticleB(AbstractArticle):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user