2010-05-27

FIX: DatabaseError: Non-nullable field id can't be None!

Hi, it is NISHIO Hirokazu. I'm moving my Django app into Google App Engine with Django-nonrel. I encountered the error and it took a lot of time from me. Google search didn't know anything about the problem.

Keep in mind: DON'T INHERIT DJANGO MODELS!

I want to add "oldid" field to keep relation information between models. Unfortunately "User" models are not mine, just be imported from django.auth, so I inherit it to add the field. It was the root of evil.

I hope it helps you :)

2 comments:

AJ said...

thank you sir :) had the same problem as you

usha said...

Hello sir,

I am seeing the same probalem, but infortunately Django does not reveal anymeaningful information for debugging. What is the fix for this issue? Unfortunately I am using django models and I am seeing similar error with a differnt field. I am able to save the data to db but I am having problem when rendering. I cannot even see the logged values in script. What is the solution, pls help?

thanks
malcom