Ignore:
Timestamp:
25 Nov 2014, 13:15:27 (10 years ago)
Author:
Henrik Bettermann
Message:

Use a baseclass for customer documents. That eases file viewlet configuration.

File:
1 edited

Legend:

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

    r12056 r12057  
    5959CustomerDocumentsContainer = attrs_to_fields(CustomerDocumentsContainer)
    6060
    61 class CustomerDocument(Document):
    62     """This is a customer document.
     61class CustomerDocumentBase(Document):
     62    """This is a customer document baseclass.
    6363    """
    6464    grok.implements(ICustomerDocument, ICustomerNavigation)
    6565    grok.provides(ICustomerDocument)
    66 
    67     def __init__(self):
    68         super(CustomerDocument, self).__init__()
    69         return
     66    grok.baseclass()
    7067
    7168    @property
     
    10299            return
    103100
    104 CustomerDocument = attrs_to_fields(CustomerDocument)
    105 
    106 class CustomerPDFDocument(CustomerDocument):
    107     """This is a customer document for a single pdf upload file only.
     101
     102class CustomerSampleDocument(CustomerDocumentBase):
     103    """This is a sample customer document.
     104    """
     105
     106CustomerSampleDocument = attrs_to_fields(CustomerSampleDocument)
     107
     108
     109class CustomerPDFDocument(CustomerDocumentBase):
     110    """This is a customer document for a single pdf upload file.
    108111    """
    109112    grok.implements(ICustomerPDFDocument, ICustomerNavigation)
     
    118121    """
    119122    grok.implements(IFactory)
    120     grok.name(u'waeup.CustomerDocument')
     123    grok.name(u'waeup.CustomerSampleDocument')
    121124    title = u"Create a new document.",
    122125    description = u"This factory instantiates new sample document instances."
    123126
    124127    def __call__(self, *args, **kw):
    125         return CustomerDocument(*args, **kw)
     128        return CustomerSampleDocument(*args, **kw)
    126129
    127130    def getInterfaces(self):
    128         return implementedBy(CustomerDocument)
     131        return implementedBy(CustomerSampleDocument)
    129132
    130133# Customer documents must be importable. So we might need a factory.
Note: See TracChangeset for help on using the changeset viewer.