Exemplo n.º 1
0
 def init_custom_bbcode_tags(self):
     """
     Find the user-defined BBCode tags and initializes their associated renderers.
     """
     BBCodeTag = get_model('precise_bbcode', 'BBCodeTag')  # noqa
     if BBCodeTag:
         custom_tags = BBCodeTag.objects.all()
         for tag in custom_tags:
             self.parser.add_bbcode_tag(tag.parser_tag_klass)
Exemplo n.º 2
0
 def init_bbcode_smilies(self):
     """
     Find the user-defined smilies tags and register them to the BBCode parser.
     """
     SmileyTag = get_model('precise_bbcode', 'SmileyTag')  # noqa
     if SmileyTag:
         custom_smilies = SmileyTag.objects.all()
         for smiley in custom_smilies:
             self.parser.add_smiley(smiley.code, smiley.html_code)