Example #1
0
 def render(self, purpose=None):
     """
     Render the line
     """
     return Markup(
         render_template('cart/sale-line.jinja', line=self,
                         purpose=purpose))
Example #2
0
    def get_description(self):
        """
        Get description of product.

        If the product is set to use the template's description, then
        the template description is sent back.

        The returned value is a `~jinja2.Markup` object which makes it
        HTML safe and can be used directly in templates. It is recommended
        to use this method instead of trying to wrap this logic in the
        templates.
        """
        if self.use_template_description:
            description = self.template.description
        else:
            description = self.description
        return Markup(description or '')