Changeset 12097 for main/waeup.ikoba/trunk/src/waeup/ikoba/products
- Timestamp:
- 30 Nov 2014, 20:49:22 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/products
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/products/interfaces.py
r12078 r12097 24 24 25 25 class AppCatSource(ContextualDictSourceFactoryBase): 26 """A application category source delivers all applicationcategories26 """A contract category source delivers all contract categories 27 27 provided in the portal. 28 28 """ … … 55 55 ) 56 56 57 application_category = schema.Choice(58 title = _(u' ApplicationCategory'),57 contract_category = schema.Choice( 58 title = _(u'Contract Category'), 59 59 source = AppCatSource(), 60 60 default = u'license', -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/product.py
r12095 r12097 66 66 def handle_product_removed(product, event): 67 67 """If a product is deleted, we make sure that also referrers to 68 customer applicationobjects are removed.68 customer contract objects are removed. 69 69 """ 70 70 prodid = product.product_id 71 71 72 # Find all customer applications that refer to given product...72 # Find all customer contracts that refer to given product... 73 73 try: 74 cat = getUtility(ICatalog, name=' applications_catalog')74 cat = getUtility(ICatalog, name='contracts_catalog') 75 75 except ComponentLookupError: 76 76 # catalog not available. This might happen during tests. 77 77 return 78 78 results = cat.searchResults(last_product_id=(prodid, prodid)) 79 for applicationin results:79 for contract in results: 80 80 # Remove that referrer... 81 application.product = None82 notify(grok.ObjectModifiedEvent( application))83 application.customer.__parent__.logger.info(81 contract.product = None 82 notify(grok.ObjectModifiedEvent(contract)) 83 contract.customer.__parent__.logger.info( 84 84 'ObjectRemovedEvent - %s - %s - removed: product' % ( 85 application.customer.customer_id, application.application_id))85 contract.customer.customer_id, contract.contract_id)) 86 86 return 87 87 -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/sample_product_data.csv
r12078 r12097 1 product_id,title, application_category1 product_id,title,contract_category 2 2 ABC,ABC title,license 3 3 CDE,CDE title,license -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_batching.py
r12078 r12097 165 165 'INFO - system - Product Processor - sample_product_data - ' 166 166 'EFG - updated: product_id=EFG, title=EFG title, ' 167 ' application_category=license\n'167 'contract_category=license\n' 168 168 in logcontent) 169 169 failcontent = open(fail_file).read() -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_export.py
r12078 r12097 62 62 result = open(self.outfile, 'rb').read() 63 63 self.assertTrue( 64 ' application_category,product_id,title,users_with_local_roles\r\n'64 'contract_category,product_id,title,users_with_local_roles\r\n' 65 65 'license,LIC,Unnamed,"[{\'user_name\': u\'john\', \'local_role\': ' 66 66 'u\'johnsrole\'}]"\r\n' … … 75 75 result = open(self.outfile, 'rb').read() 76 76 self.assertTrue( 77 ' application_category,product_id,title,users_with_local_roles\r\n'77 'contract_category,product_id,title,users_with_local_roles\r\n' 78 78 'license,LIC,Unnamed,"[{\'user_name\': u\'john\', \'local_role\': ' 79 79 'u\'johnsrole\'}]"\r\n'
Note: See TracChangeset for help on using the changeset viewer.