Ignore:
Timestamp:
22 Dec 2014, 16:42:50 (10 years ago)
Author:
Henrik Bettermann
Message:

Make EXPORTER_NAMES tuples customizable. We have many new subobject classes in custom packages.

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

Legend:

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

    r12271 r12297  
    3737    IIkobaUtils, IExtFileStore,
    3838    CREATED, REQUESTED, APPROVED)
    39 from waeup.ikoba.customers.export import EXPORTER_NAMES
    4039from waeup.ikoba.customers.interfaces import (
    4140    ICustomer, ICustomerNavigation, ICSVCustomerExporter,
     
    233232    (column `del_date`) as a UTC timestamp.
    234233    """
    235     for name in EXPORTER_NAMES:
     234    for name in getUtility(ICustomersUtils).EXPORTER_NAMES:
    236235        exporter = getUtility(ICSVCustomerExporter, name=name)
    237236        csv_data = exporter.export_customer(customer)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/export.py

    r12283 r12297  
    3232from waeup.ikoba.utils.helpers import iface_names, to_timezone
    3333
    34 #: A tuple containing all exporter names referring to customers or
    35 #: subobjects thereof.
    36 EXPORTER_NAMES = ('customers', 'customersampledocuments', 'samplecontracts')
    37 
    38 
    3934def get_customers(site, cust_filter=CustomersQuery()):
    4035    """Get all customers registered in catalog in `site`.
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_customer.py

    r12006 r12297  
    3131from zope.schema.interfaces import RequiredMissing
    3232from waeup.ikoba.interfaces import IExtFileStore, IFileStoreNameChooser
    33 from waeup.ikoba.customers.export import EXPORTER_NAMES
    3433from waeup.ikoba.customers.customer import (
    3534    Customer, CustomerFactory, handle_customer_removed, path_from_custid)
    3635from waeup.ikoba.customers.interfaces import (
    37     ICustomer, ICustomerNavigation)
     36    ICustomer, ICustomerNavigation, ICustomersUtils)
    3837from waeup.ikoba.customers.tests.test_batching import CustomerImportExportSetup
    3938from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase
     
    136135
    137136        # The customer data were put into CSV files
    138         for name in EXPORTER_NAMES:
     137        for name in getUtility(ICustomersUtils).EXPORTER_NAMES:
    139138            csv_path = os.path.join(del_dir, '%s.csv' % name)
    140139            self.assertTrue(os.path.isfile(csv_path))
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/utils.py

    r12223 r12297  
    333333    SELECTABLE_CONTYPES_DICT = CONTYPES_DICT
    334334
     335    EXPORTER_NAMES = ('customers', 'customersampledocuments', 'samplecontracts')
     336
    335337    def getPDFCreator(self, context=None):
    336338        """Get a pdf creator suitable for `context`.
  • main/waeup.ikoba/trunk/src/waeup/ikoba/utils/utils.py

    r12283 r12297  
    2929from waeup.ikoba.smtp import send_mail as send_mail_internally
    3030from waeup.ikoba.utils.helpers import get_sorted_preferred
    31 from waeup.ikoba.customers.export import EXPORTER_NAMES as CUSTOMER_EXPORTER_NAMES
    3231
    3332
     
    139138        }
    140139
    141     EXPORTER_NAMES = CUSTOMER_EXPORTER_NAMES + (
     140    EXPORTER_NAMES = (
    142141        'pdfdocuments',
    143142        'htmldocuments',
    144143        'users',
    145         'products')
     144        'products',
     145        'customers',
     146        'customersampledocuments',
     147        'samplecontracts')
    146148
    147149    BATCH_PROCESSOR_NAMES = (
Note: See TracChangeset for help on using the changeset viewer.