コード例 #1
0
 def clean_text(self):
     try:
         backend.render_text(
             self.cleaned_data['text'], self.instance.language
             or self.default_language)
     except Exception, e:
         raise ValidationError("There is an error in the markup: %s" % e)
コード例 #2
0
    def render(self, request, instance, **kwargs):
        try:
            html = backend.render_text(instance.text, instance.language)
        except Exception as e:
            html = self.render_error(e)

        # Included in a DIV, so the next item will be displayed below.
        return mark_safe('<div class="markup">' + html + '</div>\n')
コード例 #3
0
    def render(self, request, instance, **kwargs):
        try:
            html = backend.render_text(instance.text, instance.language)
        except Exception as e:
            html = self.render_error(e)

        # Included in a DIV, so the next item will be displayed below.
        return mark_safe('<div class="markup">' + html + '</div>\n')
コード例 #4
0
 def render(self, request, instance, **kwargs):
     try:
         html = backend.render_text(instance.text, instance.language)
     except Exception, e:
         html = self.render_error(e)
コード例 #5
0
 def clean_text(self):
     try:
         backend.render_text(self.cleaned_data['text'], self.instance.language or self.default_language)
     except Exception as e:
         raise ValidationError("There is an error in the markup: %s" % e)
     return self.cleaned_data['text']
コード例 #6
0
 def render(self, request, instance, **kwargs):
     try:
         html = backend.render_text(instance.text, instance.language)
     except Exception, e:
         html = self.render_error(e)