web/formfields.py
changeset 10012 8c2c6fdd8d56
parent 10006 8391bf718485
child 10612 84468b90e9c1
child 11118 0c645f09d96a
equal deleted inserted replaced
10011:340d4ef55b6f 10012:8c2c6fdd8d56
   777     """This compound field allow edition of binary stream as
   777     """This compound field allow edition of binary stream as
   778     :class:`~cubicweb.web.formfields.FileField` but expect that stream to
   778     :class:`~cubicweb.web.formfields.FileField` but expect that stream to
   779     actually contains some text.
   779     actually contains some text.
   780 
   780 
   781     If the stream format is one of text/plain, text/html, text/rest,
   781     If the stream format is one of text/plain, text/html, text/rest,
       
   782     text/markdown
   782     then a :class:`~cubicweb.web.formwidgets.TextArea` will be additionaly
   783     then a :class:`~cubicweb.web.formwidgets.TextArea` will be additionaly
   783     displayed, allowing to directly the file's content when desired, instead
   784     displayed, allowing to directly the file's content when desired, instead
   784     of choosing a file from user's file system.
   785     of choosing a file from user's file system.
   785     """
   786     """
   786     editable_formats = ('text/plain', 'text/html', 'text/rest')
   787     editable_formats = (
       
   788         'text/plain', 'text/html', 'text/rest', 'text/markdown')
   787 
   789 
   788     def render(self, form, renderer):
   790     def render(self, form, renderer):
   789         wdgs = [super(EditableFileField, self).render(form, renderer)]
   791         wdgs = [super(EditableFileField, self).render(form, renderer)]
   790         if self.format(form) in self.editable_formats:
   792         if self.format(form) in self.editable_formats:
   791             data = self.typed_value(form, load_bytes=True)
   793             data = self.typed_value(form, load_bytes=True)