Changeset 12056
- Timestamp:
- 25 Nov 2014, 11:44:47 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/batching.py
r12054 r12056 379 379 380 380 location_fields = [] 381 additional_fields = ['document_id', 'class name']382 additional_headers = ['class name']381 additional_fields = ['document_id', 'class_name'] 382 additional_headers = ['class_name'] 383 383 384 384 def checkHeaders(self, headerfields, mode='ignore'): … … 437 437 errs, inv_errs, conv_dict = super( 438 438 CustomerDocumentProcessor, self).checkConversion(row, mode=mode) 439 # We need to check if the class name corresponds with the439 # We need to check if the class_name corresponds with the 440 440 # processor chosen. This is to avoid accidentally wrong imports. 441 441 if mode != 'remove': 442 class name = row.get('classname', None)443 if class name != self.factory_name.strip('waeup.'):444 errs.append(('class name','wrong processor'))442 class_name = row.get('class_name', None) 443 if class_name != self.factory_name.strip('waeup.'): 444 errs.append(('class_name','wrong processor')) 445 445 # We have to check document_id. 446 446 document_id = row.get('document_id', None) -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12055 r12056 975 975 tableheader.append([(Id, 'document_id', 2), 976 976 (Title, 'title', 6), 977 (Type, 'translated_class name', 6),977 (Type, 'translated_class_name', 6), 978 978 (State, 'translated_state', 2), 979 979 (LT, 'formatted_transition_date', 3), -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/documentpage.pt
r12035 r12056 13 13 tal:define="files provider:files"> 14 14 <tbody> 15 <tr> 16 <td i18n:translate="" class="fieldname"> 17 Document Type: 18 </td> 19 <td> 20 <span tal:content="context/translated_class_name">CLASSNAME</span> 21 </td> 22 </tr> 15 23 <tal:widgets content="structure provider:widgets" /> 16 24 <tr tal:condition="python: files.replace('\n','')"> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/documentsmanagepage.pt
r12055 r12056 29 29 </td> 30 30 <td> 31 <span tal:content="cl/translated_class name">CLASSNAME</span>31 <span tal:content="cl/translated_class_name">CLASSNAME</span> 32 32 </td> 33 33 <td> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/documents.py
r12053 r12056 95 95 96 96 @property 97 def translated_class name(self):97 def translated_class_name(self): 98 98 try: 99 99 DOCTYPES_DICT = getUtility(ICustomersUtils).DOCTYPES_DICT 100 return DOCTYPES_DICT[self.class name]100 return DOCTYPES_DICT[self.class_name] 101 101 except KeyError: 102 102 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py
r12053 r12056 150 150 'translated_state', 151 151 'formatted_transition_date', 152 'translated_class name']))) + (152 'translated_class_name']))) + ( 153 153 'customer_id',) 154 154 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py
r12053 r12056 270 270 271 271 is_editable = Attribute('Document editable by customer') 272 translated_class name = Attribute('Translatable classname')272 translated_class_name = Attribute('Translatable class name') 273 273 274 274 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_document_data.csv
r12054 r12056 1 class name,document_id,reg_number,title1 class_name,document_id,reg_number,title 2 2 CustomerDocument,d3,1,My first doc 3 3 CustomerDocument,d4,2,My second doc -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py
r12054 r12056 318 318 def test_checkConversion(self): 319 319 errs, inv_errs, conv_dict = self.processor.checkConversion( 320 dict(document_id='d1266236341955', class name='CustomerDocument'))320 dict(document_id='d1266236341955', class_name='CustomerDocument')) 321 321 self.assertEqual(len(errs),0) 322 322 errs, inv_errs, conv_dict = self.processor.checkConversion( 323 dict(document_id='nonsense', class name='CustomerDocument'))323 dict(document_id='nonsense', class_name='CustomerDocument')) 324 324 self.assertEqual(len(errs),1) 325 325 timestamp = ("%d" % int(time()*10000))[1:] 326 326 document_id = "d%s" % timestamp 327 327 errs, inv_errs, conv_dict = self.processor.checkConversion( 328 dict(document_id=document_id, class name='CustomerDocument'))328 dict(document_id=document_id, class_name='CustomerDocument')) 329 329 self.assertEqual(len(errs),0) 330 330 errs, inv_errs, conv_dict = self.processor.checkConversion( 331 dict(document_id=document_id, class name='WrongDocument'))331 dict(document_id=document_id, class_name='WrongDocument')) 332 332 self.assertEqual(len(errs),1) 333 333 … … 339 339 fail_file = open(fail_file).read() 340 340 self.assertEqual(fail_file, 341 'class name,reg_number,document_id,title,--ERRORS--\r\n'341 'class_name,reg_number,document_id,title,--ERRORS--\r\n' 342 342 'CustomerDocument,2,d5,My stolen doc,document_id: id exists\r\n') 343 343 document = self.processor.getEntry(dict(reg_number='1', -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_document.py
r12053 r12056 61 61 self.assertEqual(container[id], document) 62 62 self.assertRaises(TypeError, container.addDocument, object()) 63 self.assertEqual(document.class name, 'CustomerDocument')63 self.assertEqual(document.class_name, 'CustomerDocument') 64 64 return 65 65 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py
r12053 r12056 138 138 self.assertEqual( 139 139 result, 140 'class name,document_id,history,last_transition_date,state,title,customer_id\r\n'140 'class_name,document_id,history,last_transition_date,state,title,customer_id\r\n' 141 141 'CustomerDocument,d101,[],,,,\r\n' 142 142 ) … … 152 152 result = open(self.outfile, 'rb').read() 153 153 self.assertTrue( 154 'class name,document_id,history,last_transition_date,state,title,customer_id\r\n'154 'class_name,document_id,history,last_transition_date,state,title,customer_id\r\n' 155 155 in result 156 156 ) … … 171 171 result = open(self.outfile, 'rb').read() 172 172 self.assertTrue( 173 'class name,document_id,history,last_transition_date,state,title,customer_id\r\n'173 'class_name,document_id,history,last_transition_date,state,title,customer_id\r\n' 174 174 in result) 175 175 self.assertMatches( … … 189 189 result = open(self.outfile, 'rb').read() 190 190 self.assertTrue( 191 'class name,document_id,history,last_transition_date,state,title,customer_id\r\n'191 'class_name,document_id,history,last_transition_date,state,title,customer_id\r\n' 192 192 in result) 193 193 self.assertMatches( -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py
r12053 r12056 81 81 82 82 @property 83 def class name(self):83 def class_name(self): 84 84 return self.__class__.__name__ 85 85 -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py
r12053 r12056 49 49 translated_state = Attribute( 50 50 'Returns a translated, more verbose verification state of a document') 51 class name = Attribute('Name of the document class')51 class_name = Attribute('Name of the document class') 52 52 formatted_transition_date = Attribute('Last transition formatted date string') 53 53
Note: See TracChangeset for help on using the changeset viewer.