-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add related name to Comments.author #127
Conversation
365b443
to
dff907e
Compare
@@ -0,0 +1,20 @@ | |||
# Generated by Django 2.2.24 on 2021-09-22 22:05 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give the migration a useful filename, like 0012_set_comments_related_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do. Have to work out how first 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think this change would break todo code in at least one place, no? Will test soon. But the system still works for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All existing tests passed. The code is running live and in use. And there are no references to comment_set, the default related_name anywhere in the code base. Looks safe to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thank you for looking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrates and works perfectly for me, thanks!
Fixing Issue 126:
#126