Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialY B
14,136 PointsUse related name instead of _set()
When we set up a Foreign Key field in our models we can assign it a related name. From what I understand we can use this instead of object_set(). Is this what you would recommend for best practice?
1 Answer
Iain Simmons
Treehouse Moderator 32,305 PointsIt's there for you to use, if you feel it would make more sense. I think it's important to know what Django sets as the default though.
You'd also want to make sure you're consistent in your naming scheme so it doesn't get all jumbled up later.
Daniel Jeffery
Courses Plus Student 26,985 PointsDaniel Jeffery
Courses Plus Student 26,985 PointsVery helpful, can you explain how related name works?
Naivedya Bansal
2,936 PointsNaivedya Bansal
2,936 PointsStep becomes "step" in step_set(). Is this django convention? What is the model name was lower case to begin with?