Changeset 12112 for main


Ignore:
Timestamp:
2 Dec 2014, 06:51:59 (10 years ago)
Author:
Henrik Bettermann
Message:

Replace 'apptype' by 'contype'.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py

    r12103 r12112  
    11261126        form = self.request.form
    11271127        customer = self.context.__parent__
    1128         apptype = form.get('apptype', None)
     1128        contype = form.get('contype', None)
    11291129        # Here we can create various instances of Contract derived
    1130         # classes depending on the apptype parameter given in form.
    1131         contract = createObject('waeup.%s' % apptype)
     1130        # classes depending on the contype parameter given in form.
     1131        contract = createObject('waeup.%s' % contype)
    11321132        self.context.addContract(contract)
    1133         apptype = getUtility(ICustomersUtils).SELECTABLE_CONTYPES_DICT[apptype]
     1133        contype = getUtility(ICustomersUtils).SELECTABLE_CONTYPES_DICT[contype]
    11341134        self.flash(_('${a} created.',
    1135             mapping = {'a': apptype}))
     1135            mapping = {'a': contype}))
    11361136        self.context.writeLogMessage(
    1137             self,'added: %s %s' % (apptype, contract.contract_id))
     1137            self,'added: %s %s' % (contype, contract.contract_id))
    11381138        self.redirect(self.url(self.context))
    11391139        return
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/contractaddform.pt

    r12099 r12112  
    88        </td>
    99        <td>
    10           <select id="apptype" name="apptype" size="1"
     10          <select id="contype" name="contype" size="1"
    1111                  class="form-control half">
    1212            <option tal:repeat="item view/selectable_contypes"
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12103 r12112  
    10661066        self.browser.getLink("Contracts").click()
    10671067        self.browser.getLink("Add contract").click()
    1068         self.browser.getControl(name="apptype").value = ['SampleContract']
     1068        self.browser.getControl(name="contype").value = ['SampleContract']
    10691069        self.browser.getControl("Create contract").click()
    10701070        self.assertTrue('Sample Contract created.' in self.browser.contents)
     
    11291129        self.browser.getLink("Contracts").click()
    11301130        self.browser.getLink("Add contract").click()
    1131         self.browser.getControl(name="apptype").value = ['SampleContract']
     1131        self.browser.getControl(name="contype").value = ['SampleContract']
    11321132        self.browser.getControl("Create contract").click()
    11331133        self.assertTrue('Sample Contract created.' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.