def result_pks(response, cast=None):
    """
    returns ids from wagtail admin search result
    :param cast: cast pks to a type, default int
    :param response: webtest response
    :return: ids list
    """
    cast = cast or int
    result_rows = response.lxml.xpath('.//tr[@data-object-pk]/@data-object-pk')
    return [
        cast(r) for r in result_rows
    ]