If you do an assignment:
x.notvalid = 'xxx'
You're just assigning xxx
to x.notvalid
. It is just python, it's like:
some_var = 'xxx'
Only you're doing it on the object x
. In this case, x
is a Django model, but it's also still a python object, and you can assign new properties to a python object like that.
If you try to access x.notvalid
before you've assigned anything to it, it will logically throw an exeption, because x.notvalid
is not assigned yet.