Projet

Général

Profil

0001-add-PicklableUpload-get_content-method-7258.patch

Thomas Noël, 19 mai 2015 08:58

Télécharger (840 octets)

Voir les différences:

Subject: [PATCH] add PicklableUpload get_content method (#7258)

 wcs/qommon/form.py | 6 ++++++
 1 file changed, 6 insertions(+)
wcs/qommon/form.py
687 687
        # quack like UploadedFile
688 688
        return self.get_file_pointer()
689 689

  
690
    def get_content(self):
691
        if hasattr(self, 'qfilename'):
692
            filename = os.path.join(get_publisher().app_dir, 'uploads', self.qfilename)
693
            return file(filename).read()
694
        return None
695

  
690 696

  
691 697
class EmailWidget(StringWidget):
692 698
    HTML_TYPE = 'email'
693
-