Ignore:
Timestamp:
27 Dec 2014, 09:47:46 (10 years ago)
Author:
Henrik Bettermann
Message:

Define a marker interface needed for the registration of the
IkobaSequenceWidget? when using the List-Choice-ProductOptionSourceFactory?
field combination primarily in IContract as a replacement for the
SourceOrderedMultiSelectWidget?.

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

Legend:

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

    r12324 r12329  
    3131    contextual_reg_num_source, GenderSource, nats_vocab,
    3232    ConCatProductSource, CustomerDocumentSource,
    33     ProductOptionSource)
     33    ProductOptionSourceFactory)
    3434
    3535
     
    314314        title = _(u'Options/Fees'),
    315315        value_type = schema.Choice(
    316             source=ProductOptionSource(),
     316            source=ProductOptionSourceFactory(),
    317317            required = True,
    318318            ),
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py

    r12324 r12329  
    2222from zope.catalog.interfaces import ICatalog
    2323from zope.interface import implements, directlyProvides
    24 from zope.schema.interfaces import ISource, IContextSourceBinder
    25 from zope.schema.interfaces import ValidationError
     24from zope.schema.interfaces import (
     25    ISource, IContextSourceBinder, ValidationError)
    2626from zc.sourcefactory.basic import BasicSourceFactory
    2727from zc.sourcefactory.contextual import BasicContextualSourceFactory
     28from zc.sourcefactory.source import FactoredContextualSource
     29from zc.sourcefactory.interfaces import IContextualSource
    2830from waeup.ikoba.sourcefactory import SmartBasicContextualSourceFactory
    2931from waeup.ikoba.interfaces import SimpleIkobaVocabulary, SUBMITTED, VERIFIED
     
    161163        return "%s - %s" % (value.document_id, value.title)
    162164
    163 class ProductOptionSource(BasicContextualSourceFactory):
     165
     166class IProductOptionSource(IContextualSource):
     167    """A source operating in context.
     168
     169    This is a marker interface needed for the registration of the
     170    IkobaSequenceWidget when using the List-Choice-ProductOptionSourceFactory
     171    field combination primarily in IContract as a replacement for
     172    the SourceOrderedMultiSelectWidget.
     173    """
     174
     175
     176class ProductOptionSource(FactoredContextualSource):
     177
     178      implements(IProductOptionSource)
     179
     180
     181class ProductOptionSourceFactory(BasicContextualSourceFactory):
    164182    """A product option source delivers all options belonging to
    165183    a selected product.
    166184    """
     185
     186    source_class = ProductOptionSource
    167187
    168188    def getValues(self, context):
  • main/waeup.ikoba/trunk/src/waeup/ikoba/widgets/overrides.zcml

    r11949 r12329  
    4343      />
    4444
     45  <!-- Register IkobaSequenceWidget for ProductOptionSource -->
     46  <adapter
     47      for="zope.schema.interfaces.IList
     48           waeup.ikoba.customers.vocabularies.IProductOptionSource
     49           zope.publisher.interfaces.browser.IBrowserRequest"
     50      provides="zope.formlib.interfaces.ISimpleInputWidget"
     51      factory="waeup.ikoba.widgets.sequencewidget.IkobaSequenceWidget"
     52      permission="zope.Public"
     53      />     
     54
    4555</configure>
Note: See TracChangeset for help on using the changeset viewer.