def force_content_unicode(self): # Content must be str with ascii encoding, or unicode! self.content = force_unicode(self.content)
def __init__(self, value): value = force_unicode(value) self.soup = self.BeautifulSoup(value)