def htmlfrombbcode(self): soup = BeautifulSoup(self.message) #remove all html tags from the message onlytext = ''.join(soup.findAll(text=True)) #get the bbcode for the text if(len(onlytext.strip()) > 0): return render_bbcode(onlytext) else : return ""
def htmlfrombbcode(self): soup = BeautifulSoup(self.message.raw) #remove all html tags from the message onlytext = ''.join(soup.findAll(text=True)) #get the bbcode for the text if (len(onlytext.strip()) > 0): return render_bbcode(onlytext) else: return ""
def htmlfrombbcode(self): if(len(self.message.strip()) > 0): return render_bbcode(self.message) else : return ""
def htmlfrombbcode(self): if (len(self.message.raw.strip()) > 0): return render_bbcode(self.message.raw) else: return ""
def forwards(self, orm): "Write your forwards methods here." for reply in orm.Reply.objects.all(): # migrate older bbcode replies to markup reply._message_rendered = render_bbcode(reply.message.raw) reply.save()