def update(self, values, **context):
schema = self.schema()<EOL>column_updates = {}<EOL>other_updates = {}<EOL>for key, value in values.items():<EOL><INDENT>try:<EOL><INDENT>column_updates[schema.column(key)] = value<EOL><DEDENT>except orb.errors.ColumnNotFound:<EOL><INDENT>other_updates[key] = value<EOL><DEDENT><DEDENT>for col in sorted(column_updates.keys(), key=lambda x: x.order()):<EOL><INDENT>self.set(col, column_updates[col], **context)<EOL><DEDENT>for key, value in other_updates.items():<EOL><INDENT>try:<EOL><INDENT>self.set(key, value, **context)<EOL><DEDENT>except orb.errors.ColumnValidationError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return len(values)<EOL>
Updates the model with the given dictionary of values.

:param values: <dict>
:param context: <orb.Context>

:return: <int>