Global name not defined error in Django/Python trying to set foreignkey
- by Mark
Summary:
I define a method createPage within a file called PageTree.py that takes a Source model object and a string.
The method tries to generate a Page model object.
It tries to set the Page model object's foreignkey to refer to the Source model object which was passed in.
This throws a NameError exception!
I'm trying to represent a website…