[Answer]-Working With OneToOne/Foreign Fields

1👍

You might want to have following model

user = models.OneToOneField(User)
weekOne = models.OneToOneField(WeekOne, null=True, default=None)
weekTwo = models.OneToOneField(WeekTwo, null=True, default=None)

Try that out, it should work. Looking at the code above you’re defining fields weekOne, weekTwo etc. What I am not sure of is if you’re assigning all necessary fields weekOne object while creating it.

Leave a comment