@classmethod<EOL><INDENT>def create(cls, values, **context):<DEDENT>
schema = cls.schema()<EOL>model = cls<EOL>polymorphic_columns = schema.columns(flags=orb.Column.Flags.Polymorphic)<EOL>if polymorphic_columns:<EOL><INDENT>polymorphic_column = polymorphic_columns.values()[<NUM_LIT:0>]<EOL>schema_name = values.get(polymorphic_column.name(), schema.name())<EOL>if schema_name and schema_name != schema.name():<EOL><INDENT>schema = orb.system.schema(schema_name)<EOL>if not schema:<EOL><INDENT>raise orb.errors.ModelNotFound(schema=schema_name)<EOL><DEDENT>else:<EOL><INDENT>model = schema.model()<EOL><DEDENT><DEDENT><DEDENT>column_values = {}<EOL>collector_values = {}<EOL>for key, value in values.items():<EOL><INDENT>obj = schema.collector(key) or schema.column(key)<EOL>if isinstance(obj, orb.Collector):<EOL><INDENT>collector_values[key] = value<EOL><DEDENT>else:<EOL><INDENT>column_values[key] = value<EOL><DEDENT><DEDENT>record = model(context=orb.Context(**context))<EOL>record.update(column_values)<EOL>record.save()<EOL>record.update(collector_values)<EOL>return record<EOL>
Shortcut for creating a new record for this table.

:param     values | <dict>

:return    <orb.Table>