Example #1
0
 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)
Example #2
0
 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
Example #3
0
 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
Example #4
0
 def _testRstMath(self):
     rst = markups.get('rst')
     if rst:
         r = rst['handler'](text_rst)
         pass
Example #5
0
 def _testRstSimple(self):
     rst = markups.get('rst')
     if rst:
         r = rst['handler'](simple_rst)
         self.assertTrue('A title' in r)