versatileimagefield/utils.py
def get_url_from_image_key(image_instance, image_key):
    """Build a URL from `image_key`."""
    img_key_split = image_key.split('__')
    if 'x' in img_key_split[-1]:
        size_key = img_key_split.pop(-1)
    else:
        size_key = None
    img_url = reduce(getattr, img_key_split, image_instance)
    if size_key:
        img_url = img_url[size_key].url
    return img_url
def get_url_from_image_key(image_instance, image_key):
    img_key_split = image_key.split('__')
    if 'x' in img_key_split[-1]:
        size_key = img_key_split.pop(-1)
    else:
        size_key = None
    img_url = reduce(getattr, img_key_split, image_instance)
    if size_key:
        img_url = img_url[size_key].url
    return img_url
def get_url_from_image_key ( image_instance , image_key ) : img_key_split = image_key . split ( '__' ) if 'x' in img_key_split [ - 1 ] : size_key = img_key_split . pop ( - 1 ) else : size_key = None img_url = reduce ( getattr , img_key_split , image_instance ) if size_key : img_url = img_url [ size_key ] . url return img_url
Build a URL from `image_key`.
Build a URL from image_key .