def styleToTags(self, style):

        try:
            s = self.styles[style]
            r1=['<font face="%s" color="#%s" ' %
                (s.fontName, s.textColor.hexval()[2:])]
            bc = s.backColor
            if bc:
                r1.append('backColor="#%s"' % bc.hexval()[2:])
            if s.trueFontSize:
                r1.append('size="%d"'%s.fontSize)
            r1.append('>')
            r2=['</font>']

            if s.strike:
                r1.append('<strike>')
                r2.insert(0,'</strike>')
            if s.underline:
                r1.append('<u>')
                r2.insert(0,'</u>')

            return [''.join(r1), ''.join(r2)]
        except KeyError:
            log.warning('Unknown class %s', style)
            return None
Get path from the related model to this field's model.
dataset/ETHPy150Open rst2pdf/rst2pdf/rst2pdf/createpdf.py/RstToPdf.styleToTags--crossover with--dataset/ETHPy150Open django/django/django/db/models/fields/related.py/ForeignKey.get_reverse_path_info