def get_resource_with_md5(project, status):
    """
    Return a queryset of CodebaseResource from `project` that have `status` and
    a non-empty size and md5.
    """
    return (
        project.codebaseresources.status(
            status=status,
        )
        .exclude(md5__exact="")
        .exclude(size__exact=0)
    )