mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #25354 -- Added class/app_label interpolation for related_query_name.
This commit is contained in:
parent
5453aa66cf
commit
f05722a08a
6 changed files with 63 additions and 18 deletions
|
@ -56,7 +56,12 @@ class Post(models.Model):
|
|||
|
||||
@python_2_unicode_compatible
|
||||
class Attachment(models.Model):
|
||||
post = models.ForeignKey(Post, models.CASCADE, related_name='attached_%(class)s_set')
|
||||
post = models.ForeignKey(
|
||||
Post,
|
||||
models.CASCADE,
|
||||
related_name='attached_%(class)s_set',
|
||||
related_query_name='attached_%(app_label)s_%(class)ss',
|
||||
)
|
||||
content = models.TextField()
|
||||
|
||||
class Meta:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue