'Update the current sync status'

def set_status(self, **attr):

    table = current.s3db.sync_status
    data = dict(((k, attr[k]) for k in attr if (k in table.fields)))
    data['timestmp'] = datetime.datetime.utcnow()
    row = current.db().select(table._id, limitby=(0, 1)).first()
    if row:
        row.update_record(**data)
    else:
        table.insert(**data)
        row = data
    return row
