from core.utils.packages.session import newQuery

def cantImages(record):
    query = newQuery("image")
    query.addFilter("object_id","==",record.id)
    images = query.count()
    return images

def cantImagesHD(record):
    query = newQuery("image")
    query.addFilter("object_id","==",record.id)
    query.addFilter("highDefinition","==",True)
    images = query.count()
    return images

def cantImagesSD(record):
    query = newQuery("image")
    query.addFilter("object_id","==",record.id)
    query.addFilter("highDefinition","==",False)
    images = query.count()
    return images


