(obj)
Returns the image associated with the object or a placeholder
Returns the image associated with the object or a placeholder
Returns the image associated with the object or a placeholder
def img(obj):
    """
    Returns the image associated with the object or a placeholder
    """
    if obj.image:
        return obj.image.url
    else:
        return urllib.parse.urljoin(settings.STATIC_URL, "images/placeholder.png")
def img ( obj ) : if obj . image : return obj . image . url else : return urllib . parse . urljoin ( settings . STATIC_URL , "images/placeholder.png" )