Ignore:
Timestamp:
24 Mar 2015, 08:59:57 (10 years ago)
Author:
uli
Message:

Return only payments (not also related objects) in search.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/browser_templates/containermanagepage.pt

    r12809 r12823  
    4141        <tr tal:repeat="value view/hitlist">
    4242          <td>
    43             <input type="checkbox" name="entries" tal:attributes="value python:value[0].__name__" />
     43            <!-- XXX: preformat values in view -->
     44            <input type="checkbox" name="entries" tal:attributes="value python:value.__name__" />
    4445          </td>
    45           <td tal:content="python: value[0].payment_id[:9]">PAYMENT_ID</td>
    46           <td tal:content="python: layout.formatDatetime(value[0].creation_date)">CREATION DATE</td>
    47           <td tal:content="python: layout.formatDatetime(value[0].payment_date)">PAYMENT DATE</td>
    48           <td tal:content="python: view.gateway_services[value[0].gateway_service].title">SERVICE</td>
    49           <td tal:content="python: value[0].amount">AMOUNT</td>
    50           <td tal:content="python: value[0].currency">CURRENCY</td>
    51           <td tal:content="python: view.payment_states.getTerm(value[0].state).title">STATE</td>
    52           <td>
    53             <span tal:condition="python: value[1] is not None">
    54               <a tal:attributes="href python: view.url(value[2])">
    55                 <span tal:content="python: value[1].title">PAYABLETITLE</span>
    56               </a>
    57             </span>
    58           </td>
     46          <td tal:content="python: value.payment_id[:9]">PAYMENT_ID</td>
     47          <td tal:content="python: layout.formatDatetime(value.creation_date)">CREATION DATE</td>
     48          <td tal:content="python: layout.formatDatetime(value.payment_date)">PAYMENT DATE</td>
     49          <td tal:content="python: view.gateway_services[value.gateway_service].title">SERVICE</td>
     50          <td tal:content="python: value.amount">AMOUNT</td>
     51          <td tal:content="python: value.currency">CURRENCY</td>
     52          <td tal:content="python: view.payment_states.getTerm(value.state).title">STATE</td>
     53          <td tal:content="python: value.title">TITLE</td>
    5954        </tr>
    6055      </tbody>
     
    6863  </div>
    6964</form>
    70 
  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/browser_templates/containerpage.pt

    r12809 r12823  
    3333      <th i18n:translate="">Currency</th>
    3434      <th i18n:translate="">State</th>
    35       <th i18n:translate="">Contract</th>
     35      <th i18n:translate="">Title</th>
    3636    </tr>
    3737    </thead>
    3838    <tbody>
    3939      <tr tal:repeat="value view/hitlist">
    40         <td tal:content="python: value[0].payment_id[:9]">PAYMENT_ID</td>
    41         <td tal:content="python: layout.formatDatetime(value[0].creation_date)">CREATION DATE</td>
    42         <td tal:content="python: layout.formatDatetime(value[0].payment_date)">PAYMENT DATE</td>
    43         <td tal:content="python: view.gateway_services[value[0].gateway_service].title">SERVICE</td>
    44         <td tal:content="python: value[0].amount">AMOUNT</td>
    45         <td tal:content="python: value[0].currency">CURRENCY</td>
    46         <td tal:content="python: view.payment_states.getTerm(value[0].state).title">STATE</td>
    47         <td>
    48           <span tal:condition="python: value[1] is not None">
    49             <a tal:attributes="href python: view.url(value[2])">
    50               <span tal:content="python: value[1].title">PAYABLETITLE</span>
    51             </a>
    52           </span>
    53         </td>
     40        <td tal:content="python: value.payment_id[:9]">PAYMENT_ID</td>
     41        <td tal:content="python: layout.formatDatetime(value.creation_date)">CREATION DATE</td>
     42        <td tal:content="python: layout.formatDatetime(value.payment_date)">PAYMENT DATE</td>
     43        <td tal:content="python: view.gateway_services[value.gateway_service].title">SERVICE</td>
     44        <td tal:content="python: value.amount">AMOUNT</td>
     45        <td tal:content="python: value.currency">CURRENCY</td>
     46        <td tal:content="python: view.payment_states.getTerm(value.state).title">STATE</td>
     47        <td tal:content="python: value.title">TITLE</td>
     48
    5449      </tr>
    5550    </tbody>
    5651  </table>
    5752</div>
    58 
  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/catalog.py

    r12775 r12823  
    2424from zope.component import queryUtility
    2525from waeup.ikoba.interfaces import ICompany
    26 from waeup.ikoba.payments.interfaces import (
    27     IPayment, IPayable
    28     )
    29 from waeup.ikoba.payments.payment import (
    30     find_payable_from_payable_id
    31     )
     26from waeup.ikoba.payments.interfaces import IPayment
    3227
    3328
    3429def search(query=None, searchtype=None):
    35     hitlist = []
     30    """Search payments catalog.
     31
     32    `query` gives a string we search, `searchtype` the fieldname.
     33    """
    3634    # Temporary solution to display all payments added
    3735    if query == '*':
     
    4139        results = Query().searchResults(
    4240            Eq(('payments_catalog', searchtype), query))
    43     hitlist = []
    44     for payment in results:
    45         payable_object = find_payable_from_payable_id(payment.payable_id)
    46         if payable_object is not None:
    47             payable = IPayable(payable_object)
    48         else:
    49             payable = None
    50         hitlist.append((payment, payable, payable_object))
    51     return hitlist
     41    return results
    5242
    5343
Note: See TracChangeset for help on using the changeset viewer.