def update(self, **values):
if not values:<EOL><INDENT>return<EOL><DEDENT>nulled_columns = set()<EOL>us = UpdateStatement(self.column_family_name, where=self._where, ttl=self._ttl,<EOL>timestamp=self._timestamp, transactions=self._transaction)<EOL>for name, val in values.items():<EOL><INDENT>col_name, col_op = self._parse_filter_arg(name)<EOL>col = self.model._columns.get(col_name)<EOL>if col is None:<EOL><INDENT>raise ValidationError("<STR_LIT>".format(self.__module__, self.model.__name__, col_name))<EOL><DEDENT>if col.is_primary_key:<EOL><INDENT>raise ValidationError("<STR_LIT>".format(col_name, self.__module__, self.model.__name__))<EOL><DEDENT>val = col.validate(val)<EOL>if val is None:<EOL><INDENT>nulled_columns.add(col_name)<EOL>continue<EOL><DEDENT>if isinstance(col, Counter):<EOL><INDENT>raise NotImplementedError<EOL><DEDENT>elif isinstance(col, (List, Set, Map)):<EOL><INDENT>if isinstance(col, List):<EOL><INDENT>klass = ListUpdateClause<EOL><DEDENT>elif isinstance(col, Set):<EOL><INDENT>klass = SetUpdateClause<EOL><DEDENT>elif isinstance(col, Map):<EOL><INDENT>klass = MapUpdateClause<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError<EOL><DEDENT>us.add_assignment_clause(klass(col_name, col.to_database(val), operation=col_op))<EOL><DEDENT>else:<EOL><INDENT>us.add_assignment_clause(AssignmentClause(<EOL>col_name, col.to_database(val)))<EOL><DEDENT><DEDENT>if us.assignments:<EOL><INDENT>self._execute(us)<EOL><DEDENT>if nulled_columns:<EOL><INDENT>ds = DeleteStatement(self.column_family_name, fields=nulled_columns, where=self._where)<EOL>self._execute(ds)<EOL><DEDENT>
Updates the rows in this queryset