mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Add related_query_name to ForeignKey/M2M. Refs #20244
This commit is contained in:
@@ -150,3 +150,11 @@ class ArticleTranslation(models.Model):
|
||||
class Meta:
|
||||
unique_together = ('article', 'lang')
|
||||
ordering = ('active_translation__title',)
|
||||
|
||||
class ArticleTag(models.Model):
|
||||
article = models.ForeignKey(Article, related_name="tags", related_query_name="tag")
|
||||
name = models.CharField(max_length=255)
|
||||
|
||||
class ArticleIdea(models.Model):
|
||||
articles = models.ManyToManyField(Article, related_name="ideas", related_query_name="idea_things")
|
||||
name = models.CharField(max_length=255)
|
||||
|
||||
Reference in New Issue
Block a user