'Updates the row with the given id.'

def update(self, id, *args, **kwargs):

    commit = kwargs.pop('commit', True)
    if isinstance(id, (list, tuple)):
        id = FilterChain(*id)
    if ((len(args) == 0) and (len(kwargs) == 1) and isinstance(kwargs.get('values'), dict)):
        kwargs = kwargs['values']
    if ((len(args) == 1) and isinstance(args[0], dict)):
        a = args[0]
        a.update(kwargs)
        kwargs = a
    kv = ',    '.join((('`%s`=%s' % (k, self.db.escape(v))) for (k, v) in kwargs.items()))
    q = ('update    `%s`    set    %s    where    %s;' % (self.name, kv, (((not isinstance(id, (Filter, FilterChain))) and cmp(self.primary_key, id, '=', self.db.escape)) or id.SQL(escape=self.db.escape))))
    self.db.execute(q, commit)
