- Checks to make sure the Schema exists for the class (i.e. add_schema decorator is added)
- If data is a list, then its interpreted as json_to_models
json_to_model
- calls
to_model
- saves raw data.
- Marshalling is unlocked.
- returns the model
- calls
to_model
- loads the schema_opts()
- creates marshmallow schema using opts
- loads the schema using the data
- returns model
If attribute exists, __getattribute__(name)
is called.
schema_class = self.Schema
x = self.name
if name is in relationship names
if marshalling is unlocked
r = schema.relationships[name]
get the relationship from the schema_class
if x is is model expected from the relationship
return x
else
x = fullfill_relationship(name)
return x if not None
else
return x
attempts to get name (getattr runs if it cannot get it)
schema_class = self.Schema
if name is in relationship names
v = fullfill_relationship(name)
return v
v = object.__getattribute__(name)
return v
if name is the name found in a relationship:
If attribute does not exist, __getattr__
is called