Exemplo n.º 1
0
def placekitten(width, height):
    """
    Creates an image of a random kitten at the provided width and height.

    Usage format:

        {% placekitten [width] [height] %}

    Example usage:

        Color image at 250 wide and 400 high
        {% placekitten 250 400 %}
    """
    url = get_placekitten_url(width, height)
    return format_html('<img src="{}"/>', url)
Exemplo n.º 2
0
 def render(self, context):
     return get_placekitten_url(
         self.width,
         self.height,
         color=self.color
     )
Exemplo n.º 3
0
 def render(self, context):
     return '<img src="%s"/>' % get_placekitten_url(self.width, self.height, color=self.color)