Ignore:
Timestamp:
30 Nov 2014, 20:49:22 (10 years ago)
Author:
Henrik Bettermann
Message:

The term 'application' should really not be used in Python-based portal software.

Replace 'application' by 'contract': batch 1

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  
    2424
    2525class AppCatSource(ContextualDictSourceFactoryBase):
    26     """A application category source delivers all application categories
     26    """A contract category source delivers all contract categories
    2727    provided in the portal.
    2828    """
     
    5555        )
    5656
    57     application_category = schema.Choice(
    58         title = _(u'Application Category'),
     57    contract_category = schema.Choice(
     58        title = _(u'Contract Category'),
    5959        source = AppCatSource(),
    6060        default = u'license',
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/product.py

    r12095 r12097  
    6666def handle_product_removed(product, event):
    6767    """If a product is deleted, we make sure that also referrers to
    68     customer application objects are removed.
     68    customer contract objects are removed.
    6969    """
    7070    prodid = product.product_id
    7171
    72     # Find all customer applications that refer to given product...
     72    # Find all customer contracts that refer to given product...
    7373    try:
    74         cat = getUtility(ICatalog, name='applications_catalog')
     74        cat = getUtility(ICatalog, name='contracts_catalog')
    7575    except ComponentLookupError:
    7676        # catalog not available. This might happen during tests.
    7777        return
    7878    results = cat.searchResults(last_product_id=(prodid, prodid))
    79     for application in results:
     79    for contract in results:
    8080        # Remove that referrer...
    81         application.product = None
    82         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(
    8484            'ObjectRemovedEvent - %s - %s - removed: product' % (
    85                 application.customer.customer_id, application.application_id))
     85                contract.customer.customer_id, contract.contract_id))
    8686    return
    8787
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/sample_product_data.csv

    r12078 r12097  
    1 product_id,title,application_category
     1product_id,title,contract_category
    22ABC,ABC title,license
    33CDE,CDE title,license
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_batching.py

    r12078 r12097  
    165165            'INFO - system - Product Processor - sample_product_data - '
    166166            'EFG - updated: product_id=EFG, title=EFG title, '
    167             'application_category=license\n'
     167            'contract_category=license\n'
    168168            in logcontent)
    169169        failcontent = open(fail_file).read()
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_export.py

    r12078 r12097  
    6262        result = open(self.outfile, 'rb').read()
    6363        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'
    6565            'license,LIC,Unnamed,"[{\'user_name\': u\'john\', \'local_role\': '
    6666            'u\'johnsrole\'}]"\r\n'
     
    7575        result = open(self.outfile, 'rb').read()
    7676        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'
    7878            'license,LIC,Unnamed,"[{\'user_name\': u\'john\', \'local_role\': '
    7979            'u\'johnsrole\'}]"\r\n'
Note: See TracChangeset for help on using the changeset viewer.