- Timestamp:
- 5 Jan 2015, 07:45:40 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py
r12385 r12401 28 28 from ikobacustom.pcn.interfaces import MessageFactory as _ 29 29 from ikobacustom.pcn.customers.interfaces import ( 30 IPCN Contract, IPCNContractEdit, IPCNContractProcess)30 IPCNLicenseContract, IPCNLicenseContractEdit, IPCNLicenseContractProcess) 31 31 32 32 33 class PCN Contract(ContractBase):33 class PCNLicenseContract(ContractBase): 34 34 """This is a sample contract. 35 35 """ 36 36 37 37 grok.implements( 38 IPCN ContractProcess,39 IPCN Contract,40 IPCN ContractEdit,38 IPCNLicenseContractProcess, 39 IPCNLicenseContract, 40 IPCNLicenseContractEdit, 41 41 ICustomerNavigation) 42 42 43 43 contract_category = 'license' 44 44 45 form_fields_interface = IPCN Contract45 form_fields_interface = IPCNLicenseContract 46 46 47 edit_form_fields_interface = IPCN ContractEdit47 edit_form_fields_interface = IPCNLicenseContractEdit 48 48 49 check_docs_interface = IPCN Contract49 check_docs_interface = IPCNLicenseContract 50 50 51 PCN Contract = attrs_to_fields(PCNContract)51 PCNLicenseContract = attrs_to_fields(PCNLicenseContract) 52 52 53 53 54 54 # Contracts must be importable. So we might need a factory. 55 class PCN ContractFactory(grok.GlobalUtility):55 class PCNLicenseContractFactory(grok.GlobalUtility): 56 56 """A factory for contracts. 57 57 """ 58 58 grok.implements(IFactory) 59 grok.name(u'waeup.PCN Contract')60 title = u"Create a new contract.",61 description = u"This factory instantiates new sample contract instances."59 grok.name(u'waeup.PCNLicenseContract') 60 title = u"Create a new license contract.", 61 description = u"This factory instantiates new license contract instances." 62 62 63 63 def __call__(self, *args, **kw): 64 return PCN Contract(*args, **kw)64 return PCNLicenseContract(*args, **kw) 65 65 66 66 def getInterfaces(self): 67 return implementedBy(PCN Contract)67 return implementedBy(PCNLicenseContract)
Note: See TracChangeset for help on using the changeset viewer.