Ignore:
Timestamp:
30 Nov 2014, 08:12:27 (10 years ago)
Author:
Henrik Bettermann
Message:

Add applications_catalog. We need this catalog for imports.

Add catalog tests.

Add attribute last_product_id. This ensures that the last product can be identified even if the product assigned to the application has been removed.

File:
1 edited

Legend:

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

    r12006 r12094  
    2727from waeup.ikoba.interfaces import (
    2828    ICompany, IQueryResultItem)
    29 from waeup.ikoba.customers.interfaces import ICustomer
     29from waeup.ikoba.customers.interfaces import ICustomer, IApplication
    3030
    3131
     
    117117    cat_name = 'customers_catalog'
    118118    defaults = dict(customer_id=None)  # make sure we get all studs by default
     119
     120
     121# Catalog for customer applications
     122
     123class ApplicationIndexes(grok.Indexes):
     124    """A catalog for all applications.
     125    """
     126    grok.site(ICompany)
     127    grok.name('applications_catalog')
     128    grok.context(IApplication)
     129
     130    application_id = grok.index.Field(attribute='application_id')
     131    last_product_id = grok.index.Field(attribute='last_product_id')
     132    application_category = grok.index.Field(attribute='application_category')
Note: See TracChangeset for help on using the changeset viewer.