- Timestamp:
- 14 Feb 2015, 08:55:35 (10 years ago)
- Location:
- main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/batching.py
r12611 r12615 32 32 IIPPMVLContract, 33 33 IRPPMVLContract, 34 IAPPITContract 34 IAPPITContract, 35 IRPTContract 35 36 ) 36 37 from ikobacustom.pcn.interfaces import MessageFactory as _ … … 119 120 120 121 class APPITContractProcessor(ContractProcessorBase): 121 """A batch processor for I RPPMVLContract objects.122 """A batch processor for IAPPITContract objects. 122 123 """ 123 124 util_name = 'appitcontractprocessor' … … 126 127 iface = IAPPITContract 127 128 factory_name = 'waeup.APPITContract' 129 130 class RPTContractProcessor(ContractProcessorBase): 131 """A batch processor for IRPTContract objects. 132 """ 133 util_name = 'rptcontractprocessor' 134 grok.name(util_name) 135 name = _('Registration as a Pharmacy Technician (Contract) Processor') 136 iface = IRPTContract 137 factory_name = 'waeup.RPTContract' -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/contracts.py
r12611 r12615 56 56 IAPPITContractProcess, 57 57 IAPPITContractOfficialUse, 58 IRPTContract, 59 IRPTContractEdit, 60 IRPTContractProcess, 61 IRPTContractOfficialUse, 58 62 ) 59 63 … … 324 328 return implementedBy(APPITContract) 325 329 330 331 class RPTContract(ContractBase): 332 """Registration as a Pharmacy Technician contract. 333 """ 334 335 grok.implements( 336 IRPTContractProcess, 337 IRPTContract, 338 IRPTContractEdit, 339 ICustomerNavigation) 340 341 contract_category = 'rpt' 342 343 form_fields_interface = IRPTContract 344 345 edit_form_fields_interface = IRPTContractEdit 346 347 ou_form_fields_interface = IRPTContractOfficialUse 348 349 check_docs_interface = IRPTContract 350 351 RPTContract = attrs_to_fields(RPTContract) 352 353 354 class RPTContractFactory(grok.GlobalUtility): 355 """A factory for contracts. 356 """ 357 grok.implements(IFactory) 358 grok.name(u'waeup.RPTContract') 359 title = u"Create a new license contract.", 360 description = u"This factory instantiates new contract instances." 361 362 def __call__(self, *args, **kw): 363 return RPTContract(*args, **kw) 364 365 def getInterfaces(self): 366 return implementedBy(RPTContract) 367 -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/export.py
r12611 r12615 30 30 IIPPMVLContractProcess, 31 31 IRPPMVLContractProcess, 32 IAPPITContractProcess) 32 IAPPITContractProcess, 33 IRPTContractProcess) 33 34 from ikobacustom.pcn.interfaces import MessageFactory as _ 34 35 … … 113 114 title = _(u'Accepting Pupil Pharmacist for Internship Training Contracts') 114 115 class_name = 'APPITContract' 116 117 class RPTContractExporter(ContractExporterBase): 118 """Exporter for Contract instances. 119 """ 120 grok.name('rptcontracts') 121 iface = IRPTContractProcess 122 title = _(u'Registration as a Pharmacy Technician Contracts') 123 class_name = 'RPTContract' -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py
r12612 r12615 1014 1014 1015 1015 """ 1016 1017 class IRPTContract(IContract): 1018 """A Registration as a Pharmacy Technician contract. 1019 1020 """ 1021 1022 state_of_origin = schema.Choice( 1023 vocabulary = nats_vocab, 1024 title = _(u'State of Origin'), 1025 required = False, 1026 ) 1027 1028 nationality = schema.Choice( 1029 vocabulary = nats_vocab, 1030 title = _(u'Nationality'), 1031 required = False, 1032 ) 1033 1034 nationality_aquired = schema.Choice( 1035 values=[_(u'birth'), _(u'naturalization')], 1036 title = _(u'Nationality acquired by'), 1037 required = False, 1038 ) 1039 1040 lga = schema.Choice( 1041 source = LGASource(), 1042 title = _(u'State / LGA'), 1043 required = False, 1044 ) 1045 1046 office_address = schema.Text( 1047 title = _(u'Offices or Business Address'), 1048 required = False, 1049 ) 1050 1051 home_address = schema.Text( 1052 title = _(u'Permanent Home Address'), 1053 required = False, 1054 ) 1055 1056 res_address = schema.Text( 1057 title = _(u'Residential Address'), 1058 required = False, 1059 ) 1060 1061 schools_attended = schema.Text( 1062 title = _(u'Schools Attended'), 1063 description = _('Enter:<br />' 1064 '(1) name of primary school, period of attendance<br />' 1065 '(2) name of secondary school, period of attendance<br />' 1066 '(3) name of post-secondary school, period of attendance'), 1067 required = False, 1068 ) 1069 1070 subjects = schema.List( 1071 title = _(u'Subjects'), 1072 value_type = ResultEntryField(), 1073 required = False, 1074 readonly = False, 1075 default = [], 1076 ) 1077 1078 referee1_name = schema.TextLine( 1079 title = _(u'First Referee Name'), 1080 required = False, 1081 readonly = False, 1082 ) 1083 1084 referee1_address = schema.Text( 1085 title = _(u'First Referee Address'), 1086 required = False, 1087 readonly = False, 1088 ) 1089 1090 referee2_name = schema.TextLine( 1091 title = _(u'Second Referee Name'), 1092 required = False, 1093 readonly = False, 1094 ) 1095 1096 referee2_address = schema.Text( 1097 title = _(u'Second Referee Address'), 1098 required = False, 1099 readonly = False, 1100 ) 1101 1102 1103 class IRPTContractOfficialUse(IIkobaObject): 1104 """Interface for editing RPT official use data. 1105 1106 """ 1107 1108 comment = schema.Text( 1109 title= _('Reason for rejection'), 1110 required = False, 1111 ) 1112 1113 1114 class IRPTContractProcess(IRPTContract, IRPTContractOfficialUse): 1115 """Interface for processing RPT data. 1116 """ 1117 1118 product_options = schema.List( 1119 title = _(u'Options/Fees'), 1120 value_type = ProductOptionField(), 1121 required = False, 1122 readonly = False, 1123 default = [], 1124 ) 1125 1126 class IRPTContractEdit(IRPTContract): 1127 """Interface for editing RPT data by customers. 1128 1129 """ -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py
r12611 r12615 37 37 RPPMVLContract, 38 38 APPITContract, 39 RPTContract, 39 40 ) 40 41 from ikobacustom.pcn.customers.interfaces import ( … … 46 47 IRPPMVLContract, 47 48 IAPPITContract, 49 IRPTContract, 48 50 ) 49 51 … … 68 70 verify.verifyObject(IAPPITContract, APPITContract()) 69 71 verify.verifyObject(ICustomerNavigation, APPITContract()) 72 verify.verifyObject(IRPTContract, RPTContract()) 73 verify.verifyObject(ICustomerNavigation, RPTContract()) 70 74 return 71 75 … … 114 118 self.assertEqual(container[id7], contract7) 115 119 self.assertEqual(contract7.class_name, 'APPITContract') 120 121 contract8= createObject(u'waeup.RPTContract') 122 id8 = contract8.contract_id 123 container.addContract(contract8) 124 self.assertEqual(container[id8], contract8) 125 self.assertEqual(contract8.class_name, 'RPTContract') 116 126 return -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/utils.py
r12611 r12615 64 64 'APPITContract': _( 65 65 'Accepting Pupil Pharmacist for Internship Training'), 66 'RPTContract': _( 67 'Registration as a Pharmacy Technician'), 66 68 } 67 69 … … 83 85 'ippmvlcontracts', 84 86 'rppmvlcontracts', 85 'appitcontracts') 87 'appitcontracts', 88 'rptcontracts')
Note: See TracChangeset for help on using the changeset viewer.