Ignore:
Timestamp:
28 Nov 2014, 08:24:49 (10 years ago)
Author:
Henrik Bettermann
Message:

Add application_category attribute to products.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/interfaces.py

    r12064 r12078  
    2323from waeup.ikoba.interfaces import MessageFactory as _
    2424
     25class AppCatSource(ContextualDictSourceFactoryBase):
     26    """A application category source delivers all application categories
     27    provided in the portal.
     28    """
     29    #: name of dict to deliver from kofa utils.
     30    DICT_NAME = 'APP_CATS_DICT'
    2531
    2632class IProductsContainer(IIkobaObject):
     
    4854        default = u'Unnamed',
    4955        )
     56
     57    application_category = schema.Choice(
     58        title = _(u'Application Category'),
     59        source = AppCatSource(),
     60        default = u'license',
     61        required = True,
     62        )
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/sample_product_data.csv

    r12073 r12078  
    1 product_id,title
    2 ABC,ABC title
    3 CDE,CDE title
    4 EFG,EFG title
    5 ABC,Duplicate product
     1product_id,title,application_category
     2ABC,ABC title,license
     3CDE,CDE title,license
     4EFG,EFG title,license
     5ABC,Duplicate product,license
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_batching.py

    r12077 r12078  
    164164        self.assertTrue(
    165165            'INFO - system - Product Processor - sample_product_data - '
    166             'EFG - updated: product_id=EFG, title=EFG title\n'
     166            'EFG - updated: product_id=EFG, title=EFG title, '
     167            'application_category=license\n'
    167168            in logcontent)
    168169        failcontent = open(fail_file).read()
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_export.py

    r12077 r12078  
    6262        result = open(self.outfile, 'rb').read()
    6363        self.assertTrue(
    64             'product_id,title,users_with_local_roles\r\nLIC,Unnamed,"'
    65             '[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"\r\n'
     64            'application_category,product_id,title,users_with_local_roles\r\n'
     65            'license,LIC,Unnamed,"[{\'user_name\': u\'john\', \'local_role\': '
     66            'u\'johnsrole\'}]"\r\n'
    6667            in result
    6768            )
     
    7475        result = open(self.outfile, 'rb').read()
    7576        self.assertTrue(
    76             'product_id,title,users_with_local_roles\r\nLIC,Unnamed,"'
    77             '[{\'user_name\': u\'john\', \'local_role\': u\'johnsrole\'}]"\r\n'
     77            'application_category,product_id,title,users_with_local_roles\r\n'
     78            'license,LIC,Unnamed,"[{\'user_name\': u\'john\', \'local_role\': '
     79            'u\'johnsrole\'}]"\r\n'
    7880            in result
    7981            )
  • main/waeup.ikoba/trunk/src/waeup/ikoba/utils/utils.py

    r12060 r12078  
    101101    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
    102102        return sorted_phone_prefixes(data, request)
     103
     104    APP_CATS_DICT = {
     105        'license': 'License',
     106        'no': 'no application',
     107        }
    103108
    104109    EXAM_SUBJECTS_DICT = {
Note: See TracChangeset for help on using the changeset viewer.