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!
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 trial
Rey Adronico Baguio13,672 Points
Why was it important for us to put a quotations around "Writer" when we assigned it as a Foreign Key to Article?
Couldn't we just put the Writer Model first? And how did putting quotes around them fix the order of writing the model?
Chris FreemanTreehouse Moderator 68,320 Points
From the docs ForeignKey
If you need to create a relationship on a model that has not yet been defined, you can use the name of the model, rather than the model object itself
Since Writer is defined after Article, it is not yet defined when the ForeignKey is defined. The quotes tell Django to look for the Writer model later on in the code.