         return ret
 
     # Set data and update collection
-    setData: (id, val) =>
+    setData: (key, val, key2, val2) =>
         if val
-            @data[id] = val
-        else
-            delete @data[id]
+            @data[key] = val
+        else if key
+            delete @data[key]
+        if val2
+            @data[key2] = val2
+        else if key2
+            delete @data[key2]
         if @router
-            @updateUrl id, val
+            @updateUrl()
         @update()
 
     # Creates a filter from a filter config definition

    # Go to the previous page in the collection
    prevPage: =>
        if @data.page > 1
            @data.page = @data.page - 1
            $(".page", @$el).html @data.page
            @update()

    # Go to the next page in the collection
    nextPage: =>
        # Since we don't have a collection count, for now we use the size of
        # the last GET as an heuristic to limit the use of nextPage
        if @collection.length == @data.size
            @data.page = @data.page + 1
            $(".page", @$el).html @data.page
            @update()

    # Toggle/Select sort column and direction, and update table accodingly
    toggleSort: (e) =>
        el = e.currentTarget
        cl = el.className
        if cl.indexOf("sorting_desc") >= 0
            @data.sort_dir = "asc"
            cl = "sorting_asc"
        else if cl.indexOf("sorting") >= 0 or cl.indexOf("sorting_asc") >= 0
            @data.sort_dir = "desc"
            cl = "sorting_desc"
        else
            return @
        $("th", @$el).removeClass("sorting_desc sorting_asc")
        $(el, @$el).addClass(cl)
        @data.sort_col = el.abbr
        @update()

    # Apply a template to a model and return the result (string), or empty
    # string if model is false/undefined
    applyTemplate: (template, model) ->
        (model and template model: model) or ""

    # Render skeleton of the table, creating filters and other additions,
    # and trigger an update of the collection

            status:
                type: "option"
                options: ["all", "valid", "invalid"]
###
class Backbone.TableView extends Backbone.View
    tagName: "div"
    titleTemplate: _.template "<h2><%= model %></h2>"
    searchTemplate: _.template """
        <input type="text" class="search-query pull-right" placeholder="<%= model.detail || model %>" value="<%= data[model.query || "q"] || "" %>"></input>
    """
    paginationTemplate: _.template """
        <ul class="pager">
            <li class="pager-prev">
                <a href="javascript:void(0)">&larr; Prev</a>
            </li>
            <span class="badge badge-info page"><%= data.page %></span>
            <li class="pager-next">
                <a href="javascript:void(0)">Next &rarr;</a>
            </li>
