@classmethod<EOL><INDENT>def from_serializable_data(cls, data, check_fks=True, strict_fks=False):<DEDENT>
obj = model_from_serializable_data(cls, data, check_fks=check_fks, strict_fks=strict_fks)<EOL>if obj is None:<EOL><INDENT>return None<EOL><DEDENT>child_relations = get_all_child_relations(cls)<EOL>for rel in child_relations:<EOL><INDENT>rel_name = rel.get_accessor_name()<EOL>try:<EOL><INDENT>child_data_list = data[rel_name]<EOL><DEDENT>except KeyError:<EOL><INDENT>continue<EOL><DEDENT>related_model = rel.related_model<EOL>if hasattr(related_model, '<STR_LIT>'):<EOL><INDENT>children = [<EOL>related_model.from_serializable_data(child_data, check_fks=check_fks, strict_fks=True)<EOL>for child_data in child_data_list<EOL>]<EOL><DEDENT>else:<EOL><INDENT>children = [<EOL>model_from_serializable_data(related_model, child_data, check_fks=check_fks, strict_fks=True)<EOL>for child_data in child_data_list<EOL>]<EOL><DEDENT>children = filter(lambda child: child is not None, children)<EOL>setattr(obj, rel_name, children)<EOL><DEDENT>return obj<EOL>
Build an instance of this model from the JSON-like structure passed in,
recursing into related objects as required.
If check_fks is true, it will check whether referenced foreign keys still
exist in the database.
- dangling foreign keys on related objects are dealt with by either nullifying the key or
dropping the related object, according to the 'on_delete' setting.
- dangling foreign keys on the base object will be nullified, unless strict_fks is true,
in which case any dangling foreign keys with on_delete=CASCADE will cause None to be
returned for the entire object.