Commit 85d2a5f1 authored by Matthew Wilkes's avatar Matthew Wilkes

LP #1103583: tag() should not be publishable

parent 90360c44
...@@ -835,21 +835,19 @@ class Image(File): ...@@ -835,21 +835,19 @@ class Image(File):
security.declareProtected(View, 'tag') security.declareProtected(View, 'tag')
def tag(self, height=None, width=None, alt=None, def tag(self, height=None, width=None, alt=None,
scale=0, xscale=0, yscale=0, css_class=None, title=None, **args): scale=0, xscale=0, yscale=0, css_class=None, title=None, **args):
""" # Generate an HTML IMG tag for this image, with customization.
Generate an HTML IMG tag for this image, with customization. # Arguments to self.tag() can be any valid attributes of an IMG tag.
Arguments to self.tag() can be any valid attributes of an IMG tag. # 'src' will always be an absolute pathname, to prevent redundant
'src' will always be an absolute pathname, to prevent redundant # downloading of images. Defaults are applied intelligently for
downloading of images. Defaults are applied intelligently for # 'height', 'width', and 'alt'. If specified, the 'scale', 'xscale',
'height', 'width', and 'alt'. If specified, the 'scale', 'xscale', # and 'yscale' keyword arguments will be used to automatically adjust
and 'yscale' keyword arguments will be used to automatically adjust # the output height and width values of the image tag.
the output height and width values of the image tag. #
# Since 'class' is a Python reserved word, it cannot be passed in
Since 'class' is a Python reserved word, it cannot be passed in # directly in keyword arguments which is a problem if you are
directly in keyword arguments which is a problem if you are # trying to use 'tag()' to include a CSS class. The tag() method
trying to use 'tag()' to include a CSS class. The tag() method # will accept a 'css_class' argument that will be converted to
will accept a 'css_class' argument that will be converted to # 'class' in the output tag to work around this.
'class' in the output tag to work around this.
"""
if height is None: height=self.height if height is None: height=self.height
if width is None: width=self.width if width is None: width=self.width
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment