Issue
Hi I am getting this error because I have a field in my additional user info model (user = models.OneToOneField(User)
) that I am not filling in at sign up (as I want to let the user do it later).
I wondered if there was any way to solve this problem other than allowing null field in the db?
Cheers
Solution
Try to
user = models.OneToOneField(User, null=True, blank=True)
And then recreate your db. You can find more on https://docs.djangoproject.com/en/1.4/ref/models/fields/#null
Else you can use Proxy models:
class UserExtraInfo(User):
#here your extra fields
In this case you won`t need to create UserExtraInfo instance in same time with User. Read more on https://docs.djangoproject.com/en/1.4/topics/db/models/#model-inheritance
Answered By - Hellpain
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.