Ignore:
Timestamp:
13 Nov 2011, 10:22:25 (13 years ago)
Author:
Henrik Bettermann
Message:

File name choosers generally don't know the extension of the file stored. So we have to feed the chooseName method with the extension (ext) of the file stored in the file system.

This may conflict somehow with the idea behind the file name chooser. I think you (Uli) intended to use only the attr parameter to select a proper extension. In my opinion it's better to use attr and ext.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py

    r7102 r7103  
    288288    grok.baseclass()
    289289    attr = None
     290    ext = u'.jpg'
    290291
    291292    def render(self):
     
    293294        # for file storage.
    294295        image = getUtility(IExtFileStore).getFileByContext(
    295             self.context, attr=self.attr)
     296            self.context, attr=self.attr, ext=self.ext)
    296297        self.response.setHeader(
    297298            'Content-Type', 'image/jpeg')
     
    306307    grok.name('birth_certificate.jpg')
    307308    attr = u'birth_certificate'
     309    ext = u'.jpg'
Note: See TracChangeset for help on using the changeset viewer.