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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.