I created the following ForeignKey field in my model under a class called "Activity"
related_workoutrecord = models.ForeignKey(WorkoutRecord, null=True, blank=True)
The ForeignKey belongs to the WorkoutRecord class, which must be empty.
After adding this column, I ran south and received the following error message:
NameError: name 'WorkoutRecord' is not defined
Any thoughts on what's going on? I confirmed that "WorkoutRecord" is a class in my model.
Is it necessary to write WorkoutRecord as a string (with quotes), for example:
related_workoutrecord = models.ForeignKey('WorkoutRecord', null=True, blank=True)
I appreciate the feedback
source share