- Timestamp:
- 25 Nov 2014, 08:19:54 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py
r12035 r12053 33 33 from waeup.ikoba.customers.interfaces import ( 34 34 ICustomerDocumentsContainer, ICustomerNavigation, ICustomerDocument, 35 ICustomersUtils )35 ICustomersUtils, ICustomerPDFDocument) 36 36 from waeup.ikoba.documents import DocumentsContainer, Document 37 37 from waeup.ikoba.documents.interfaces import IDocumentsUtils … … 60 60 61 61 class CustomerDocument(Document): 62 """This is a ndocument.62 """This is a customer document. 63 63 """ 64 64 grok.implements(ICustomerDocument, ICustomerNavigation) … … 94 94 return True 95 95 96 @property 97 def translated_classname(self): 98 try: 99 DOCTYPES_DICT = getUtility(ICustomersUtils).DOCTYPES_DICT 100 return DOCTYPES_DICT[self.classname] 101 except KeyError: 102 return 103 96 104 CustomerDocument = attrs_to_fields(CustomerDocument) 105 106 class CustomerPDFDocument(CustomerDocument): 107 """This is a customer document for a single pdf upload file only. 108 """ 109 grok.implements(ICustomerPDFDocument, ICustomerNavigation) 110 grok.provides(ICustomerPDFDocument) 111 112 CustomerPDFDocument = attrs_to_fields(CustomerPDFDocument) 97 113 98 114 … … 104 120 grok.name(u'waeup.CustomerDocument') 105 121 title = u"Create a new document.", 106 description = u"This factory instantiates new document instances."122 description = u"This factory instantiates new sample document instances." 107 123 108 124 def __call__(self, *args, **kw): … … 111 127 def getInterfaces(self): 112 128 return implementedBy(CustomerDocument) 129 130 # Customer documents must be importable. So we might need a factory. 131 class CustomerPDFDocumentFactory(grok.GlobalUtility): 132 """A factory for customer pdf documents. 133 """ 134 grok.implements(IFactory) 135 grok.name(u'waeup.CustomerPDFDocument') 136 title = u"Create a new document.", 137 description = u"This factory instantiates new pdf document instances." 138 139 def __call__(self, *args, **kw): 140 return CustomerPDFDocument(*args, **kw) 141 142 def getInterfaces(self): 143 return implementedBy(CustomerPDFDocument) 113 144 114 145 #: The file id marker for customer files
Note: See TracChangeset for help on using the changeset viewer.