@classmethod<EOL><INDENT>def inflate(cls, values, **context):<DEDENT>
context = orb.Context(**context)<EOL>if isinstance(values, Model):<EOL><INDENT>record = values<EOL>values = dict(values)<EOL><DEDENT>else:<EOL><INDENT>record = None<EOL><DEDENT>schema = cls.schema()<EOL>polymorphs = schema.columns(flags=orb.Column.Flags.Polymorphic).values()<EOL>column = polymorphs[<NUM_LIT:0>] if polymorphs else None<EOL>if column and column.field() in values:<EOL><INDENT>morph_cls_name = values.get(column.name(), values.get(column.field()))<EOL>morph_cls = orb.system.model(morph_cls_name)<EOL>id_col = schema.idColumn().name()<EOL>if morph_cls and morph_cls != cls:<EOL><INDENT>try:<EOL><INDENT>record = morph_cls(values[id_col], context=context)<EOL><DEDENT>except KeyError:<EOL><INDENT>raise orb.errors.RecordNotFound(schema=morph_cls.schema(),<EOL>column=values.get(id_col))<EOL><DEDENT><DEDENT><DEDENT>if record is None:<EOL><INDENT>event = orb.events.LoadEvent(record=record, data=values)<EOL>record = cls(loadEvent=event, context=context)<EOL><DEDENT>return record<EOL>
Returns a new record instance for the given class with the values
defined from the database.

:param      cls     | <subclass of orb.Table>
            values  | <dict> values

:return     <orb.Table>