Ignore:
Timestamp:
12 Jan 2015, 09:18:36 (10 years ago)
Author:
Henrik Bettermann
Message:

Remove redundant code and set download_filename only for pdf files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/fileviewlets.py

    r12444 r12446  
    9292    mus = 1024 * 200
    9393    download_name = u'sample'
     94    download_filename = download_name
    9495    tab_redirect = '#tab2'
    9596
     
    115116    title = _(u'Sample Scan')
    116117    download_name = u'sample'
     118    download_filename = download_name
    117119
    118120
     
    120122    """Scan document.
    121123    """
     124
    122125    grok.name('sample')
    123126    grok.context(CustomerSampleDocument)
    124127    grok.require('waeup.viewCustomer')
    125128    download_name = u'sample'
     129    download_filename = download_name
    126130
    127131
     
    141145    download_name = u'sample.pdf'
    142146    tab_redirect = '#tab2'
     147
     148    @property
     149    def download_filename(self):
     150        return u"%s.pdf" % self.context.document_id[:9]
    143151
    144152
     
    161169    download_name = u'sample.pdf'
    162170
     171    @property
     172    def download_filename(self):
     173        return u"%s.pdf" % self.context.document_id[:9]
     174
    163175
    164176class PDFScanImage(Image):
     
    170182    download_name = u'sample.pdf'
    171183
     184    @property
     185    def download_filename(self):
     186        return u"%s" % self.context.document_id[:9]
     187
    172188
    173189class PDFScanSlip(PDFScanDisplay):
Note: See TracChangeset for help on using the changeset viewer.