def to_dojo_data(items, identifier='id', num_rows=None):
    """Return the data as the dojo.data API defines.
    The dojo.data API expects the data like so:
    {identifier:"whatever",
     items: [
         {name:"Lenin", id:3, ....},
     ]
    }
    The identifier is optional.
    """
    ret = {'items':items}
    if identifier:
        ret['identifier'] = identifier
    if num_rows:
        ret['numRows'] = num_rows
    return ret