Django model object initialization
If I do
obj = Object() obj.att1 = 'test' obj.att2 = 'test' obj.save()
obj.id --> works fine
But if I do
Doing obj.id --> obj seems to be Nonetype at this stage
Is this the case?
I don't know the exact framework you are using, but I am going to take a guess as to the problem:
The save() function doesn't appear to return the Object instance, it returns None. So you would normally:
Then check obj.id.