Skip to content

Commit

Permalink
Add related name to Comments.author
Browse files Browse the repository at this point in the history
  • Loading branch information
bernd-wechner committed Sep 22, 2021
1 parent 20196a1 commit dff907e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion todo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ class Comment(models.Model):
"""

author = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True,
related_name="todo_comments"
)
task = models.ForeignKey(Task, on_delete=models.CASCADE)
date = models.DateTimeField(default=datetime.datetime.now)
Expand Down

0 comments on commit dff907e

Please sign in to comment.