Ignore:
Timestamp:
7 Dec 2014, 19:48:03 (10 years ago)
Author:
Henrik Bettermann
Message:

Add some comments to emphasize that we usually attach only one file to each document.

File:
1 edited

Legend:

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

    r12162 r12164  
    6767    grok.baseclass()
    6868
     69    # Ikoba can store any number of files per Document object.
     70    # However, we highly recommend to associate and store
     71    # only one file per Document object. Thus the following
     72    # tuple should contain only a single filename string.
    6973    filenames = ()
    7074
     
    113117        files = []
    114118        try:
     119            # Usually there is only a single element in self.filenames.
    115120            for filename in self.filenames:
    116121                attrname = filename.replace('.','_')
     
    124129
    125130    def setMD5(self):
    126         """Set md5 checksum attribute for all files connected to this document.
     131        """Set md5 checksum attribute for files connected to this document.
    127132        """
    128133        connected_files = self.connected_files
     
    139144    """
    140145
     146    # Ikoba can store any number of files per Document object.
     147    # However, we highly recommend to associate and store
     148    # only one file per Document object. Thus the following
     149    # tuple should contain only a single filename string.
    141150    filenames = ('sample',)
    142151
     
    150159    grok.provides(ICustomerPDFDocument)
    151160
     161    # Ikoba can store any number of files per Document object.
     162    # However, we highly recommend to associate and store
     163    # only one file per Document object. Thus the following
     164    # tuple should contain only a single filename string.
     165    filenames = ('sample.pdf',)
     166
    152167CustomerPDFDocument = attrs_to_fields(CustomerPDFDocument)
    153168
    154169
    155 # Customer documents must be importable. So we might need a factory.
     170# Customer documents must be importable. So we need a factory.
    156171class CustomerDocumentFactory(grok.GlobalUtility):
    157172    """A factory for customer documents.
Note: See TracChangeset for help on using the changeset viewer.