def save(self, force_insert=False, force_update=False, source = None, using=None): instance = self.object mkp = markups.get(self.markup) try: repr = instance.representation(mkp) except Exception, e: logger.error('Failed to render {0}. {1}'.format(instance,e)) repr = smart_unicode(instance)
def __unicode__(self): mkp = markups.get('crl') if mkp: handler = mkp.get('handler') try: return handler(smart_unicode(self.message)) except: return self.message else: return self.message
def htmlbody(self): text = self.body if not text: return '' mkp = markuplib.get(self.markup) if mkp: handler = mkp.get('handler') text = handler(text) text = mark_safe(force_str(text)) return text
def _testRstMath(self): rst = markups.get('rst') if rst: r = rst['handler'](text_rst) pass
def _testRstSimple(self): rst = markups.get('rst') if rst: r = rst['handler'](simple_rst) self.assertTrue('A title' in r)