Changeset 12571 for main/ikobacustom.pcn/trunk
- Timestamp:
- 9 Feb 2015, 08:30:13 (10 years ago)
- Location:
- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/batching.py
r12499 r12571 27 27 IPCNCustomerPDFDocument, 28 28 IRONContract, 29 IROPContract) 29 IROPContract, 30 IRPRContract) 30 31 from ikobacustom.pcn.interfaces import MessageFactory as _ 31 32 … … 75 76 iface = IROPContract 76 77 factory_name = 'waeup.ROPContract' 78 79 class RPRContractProcessor(ContractProcessorBase): 80 """A batch processor for IRPRContract objects. 81 """ 82 util_name = 'rprcontractprocessor' 83 grok.name(util_name) 84 name = _('Registration in the Provisional Register Contract Processor') 85 iface = IRPRContract 86 factory_name = 'waeup.RPRContract' -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py
r12501 r12571 28 28 from ikobacustom.pcn.interfaces import MessageFactory as _ 29 29 from ikobacustom.pcn.customers.interfaces import ( 30 IRONContract, IRONContractEdit, IRONContractProcess, 31 IROPContract, IROPContractEdit, IROPContractProcess, 32 IRONContractOfficialUse, IROPContractOfficialUse) 30 IRONContract, 31 IRONContractEdit, 32 IRONContractProcess, 33 IRONContractOfficialUse, 34 IROPContract, 35 IROPContractEdit, 36 IROPContractProcess, 37 IROPContractOfficialUse, 38 IRPRContract, 39 IRPRContractEdit, 40 IRPRContractProcess, 41 IRPRContractOfficialUse, 42 ) 33 43 34 44 … … 107 117 def getInterfaces(self): 108 118 return implementedBy(ROPContract) 119 120 121 class RPRContract(ContractBase): 122 """Registration in the Provisional Register contract. 123 """ 124 125 grok.implements( 126 IRPRContractProcess, 127 IRPRContract, 128 IRPRContractEdit, 129 ICustomerNavigation) 130 131 contract_category = 'rpr' 132 133 form_fields_interface = IRPRContract 134 135 edit_form_fields_interface = IRPRContractEdit 136 137 ou_form_fields_interface = IRPRContractOfficialUse 138 139 check_docs_interface = IRPRContract 140 141 RPRContract = attrs_to_fields(RPRContract) 142 143 144 class RPRContractFactory(grok.GlobalUtility): 145 """A factory for contracts. 146 """ 147 grok.implements(IFactory) 148 grok.name(u'waeup.RPRContract') 149 title = u"Create a new license contract.", 150 description = u"This factory instantiates new contract instances." 151 152 def __call__(self, *args, **kw): 153 return RPRContract(*args, **kw) 154 155 def getInterfaces(self): 156 return implementedBy(RPRContract) -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py
r12501 r12571 23 23 from ikobacustom.pcn.customers.interfaces import ( 24 24 IPCNCustomer, IPCNCustomerJPGDocument, 25 IPCNCustomerPDFDocument, IRONContractProcess, IROPContractProcess) 25 IPCNCustomerPDFDocument, 26 IRONContractProcess, 27 IROPContractProcess, 28 IRPRContractProcess) 26 29 from ikobacustom.pcn.interfaces import MessageFactory as _ 27 30 … … 66 69 title = _(u'Registration of Premises Contracts') 67 70 class_name = 'ROPContract' 71 72 class RPRContractExporter(ContractExporterBase): 73 """Exporter for Contract instances. 74 """ 75 grok.name('rprcontracts') 76 iface = IRPRContractProcess 77 title = _(u'Registration in the Provisional Register Contracts') 78 class_name = 'RPRContract' -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py
r12536 r12571 30 30 from ikobacustom.pcn.interfaces import MessageFactory as _ 31 31 from ikobacustom.pcn.interfaces import LGASource 32 from ikobacustom.pcn.customers.schoolgrades import ResultEntryField 32 33 33 34 def year_range(): … … 104 105 ) 105 106 106 res_address = schema.Text(107 title = _(u'Residential Address'),108 required = False,109 )110 111 107 work_address = schema.Text( 112 108 title = _(u'Work Address'), … … 293 289 # required = True, 294 290 # ) 291 292 class IRPRContract(IContract): 293 """A Registration in the Provisional Register contract. 294 295 """ 296 297 state_of_origin = schema.Choice( 298 vocabulary = nats_vocab, 299 title = _(u'State of Origin'), 300 required = False, 301 ) 302 303 res_address = schema.Text( 304 title = _(u'Residential Address'), 305 required = False, 306 ) 307 308 qualifications = schema.List( 309 title = _(u'Qualifications'), 310 value_type = ResultEntryField(), 311 required = False, 312 default = [], 313 ) 314 315 certificates = schema.Choice( 316 title = _(u'Certificates'), 317 source = CustomerDocumentSource(), 318 required = False, 319 ) 320 321 referee1_name = schema.TextLine( 322 title = _(u'First Referee Name'), 323 required = False, 324 readonly = False, 325 ) 326 327 referee1_address = schema.Text( 328 title = _(u'First Referee Address'), 329 required = False, 330 readonly = False, 331 ) 332 333 referee1_license = schema.TextLine( 334 title = _(u'First Referee License Number'), 335 required = False, 336 readonly = False, 337 ) 338 339 referee2_name = schema.TextLine( 340 title = _(u'Second Referee Name'), 341 required = False, 342 readonly = False, 343 ) 344 345 referee2_address = schema.Text( 346 title = _(u'Second Referee Address'), 347 required = False, 348 readonly = False, 349 ) 350 351 referee2_license = schema.TextLine( 352 title = _(u'Second Referee License Number'), 353 required = False, 354 readonly = False, 355 ) 356 357 internship_address = schema.Text( 358 title = _(u'Internship'), 359 description = u'Enter address of company where you want to serve your internship.', 360 required = False, 361 readonly = False, 362 ) 363 364 365 366 class IRPRContractOfficialUse(IIkobaObject): 367 """Interface for editing RON official use data. 368 369 """ 370 371 comment = schema.Text( 372 title= _('Reason for rejection'), 373 required = False, 374 ) 375 376 377 class IRPRContractProcess(IRPRContract, IRPRContractOfficialUse): 378 """Interface for processing RON data. 379 """ 380 381 product_options = schema.List( 382 title = _(u'Options/Fees'), 383 value_type = ProductOptionField(), 384 required = False, 385 readonly = False, 386 default = [], 387 ) 388 389 class IRPRContractEdit(IRPRContract): 390 """Interface for editing RON data by customers. 391 392 """ 393 394 certificates = schema.Choice( 395 title = _(u'Certificates'), 396 source = CustomerDocumentSource(), 397 required = True, 398 ) -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py
r12499 r12571 29 29 30 30 from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.pcn.customers.contracts import RONContract, ROPContract 32 from ikobacustom.pcn.customers.interfaces import IRONContract, IROPContract 31 from ikobacustom.pcn.customers.contracts import ( 32 RONContract, 33 ROPContract, 34 RPRContract, 35 ) 36 from ikobacustom.pcn.customers.interfaces import ( 37 IRONContract, 38 IROPContract, 39 IRPRContract, 40 ) 33 41 34 42 … … 44 52 verify.verifyObject(IROPContract, ROPContract()) 45 53 verify.verifyObject(ICustomerNavigation, ROPContract()) 54 verify.verifyObject(IRPRContract, RPRContract()) 55 verify.verifyObject(ICustomerNavigation, RPRContract()) 46 56 return 47 57 … … 59 69 container.addContract(contract2) 60 70 self.assertEqual(container[id2], contract2) 61 self.assertRaises(TypeError, container.addContract, object())62 71 self.assertEqual(contract2.class_name, 'ROPContract') 72 73 contract3 = createObject(u'waeup.RPRContract') 74 id3 = contract3.contract_id 75 container.addContract(contract3) 76 self.assertEqual(container[id3], contract3) 77 self.assertEqual(contract3.class_name, 'RPRContract') 63 78 return -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py
r12529 r12571 56 56 'RONContract': _('Retention of Name on the Registrar'), 57 57 'ROPContract': _('Registration of Premises'), 58 'RPRContract': _('Registration in the Provisional Register'), 58 59 } 59 60 … … 67 68 'pcncustomerpdfdocuments', 68 69 'roncontracts', 69 'ropcontracts') 70 'ropcontracts', 71 'rprcontracts') -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/utils/utils.py
r12546 r12571 48 48 'ron': 'Retention of Name', 49 49 'rop': 'Registration of Premises', 50 'rpr': 'Registration in the Provisional Register', 50 51 'no': 'no license', 51 52 }
Note: See TracChangeset for help on using the changeset viewer.