Ignore:
Timestamp:
26 Dec 2014, 20:18:17 (10 years ago)
Author:
Henrik Bettermann
Message:

Rename ProductOptionEntry? ProductOption?.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/utils
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/utils/converters.py

    r12309 r12327  
    3030from zope.schema.interfaces import IList
    3131from waeup.ikoba.interfaces import (
    32     IObjectConverter, IProductOptionEntryField, IFieldConverter,
     32    IObjectConverter, IProductOptionField, IFieldConverter,
    3333    DELETION_MARKER, IGNORE_MARKER)
    3434from waeup.ikoba.schema.interfaces import IPhoneNumber
    35 from waeup.ikoba.products.productoptions import ProductOptionEntry
     35from waeup.ikoba.products.productoptions import ProductOption
    3636
    3737class ExtendedCheckBoxWidget(CheckBoxWidget):
     
    175175        return result
    176176
    177 class ProductOptionEntryConverter(grok.Adapter):
    178     grok.context(IProductOptionEntryField)
     177class ProductOptionConverter(grok.Adapter):
     178    grok.context(IProductOptionField)
    179179    grok.implements(IFieldConverter)
    180180
    181181    def request_data(self, name, value, schema_field, prefix='',
    182182                     mode='create'):
    183         """Turn CSV values into ProductOptionEntry-compatible form data.
     183        """Turn CSV values into ProductOption-compatible form data.
    184184
    185185        Expects as `value` a _string_ like ``(u'mytitle',
     
    194194        where the values are tokens from appropriate sources.
    195195
    196         Such dicts can be transformed into real ProductOptionEntry objects by
     196        Such dicts can be transformed into real ProductOption objects by
    197197        input widgets used in converters.
    198198        """
    199199        try:
    200             entry = ProductOptionEntry.from_string(value)
     200            entry = ProductOption.from_string(value)
    201201            title, fee, currency = entry.title, entry.fee, entry.currency
    202202        except:
  • main/waeup.ikoba/trunk/src/waeup/ikoba/utils/tests/test_converters.py

    r12309 r12327  
    3838    SimpleIkobaVocabulary, IFieldConverter,
    3939    DELETION_MARKER, IGNORE_MARKER)
    40 from waeup.ikoba.products.productoptions import ProductOptionEntryField
     40from waeup.ikoba.products.productoptions import ProductOptionField
    4141from waeup.ikoba.utils.converters import (
    4242    IObjectConverter, IFieldConverter, DefaultFieldConverter,
    43     ListFieldConverter, PhoneNumberFieldConverter, ProductOptionEntryConverter,
     43    ListFieldConverter, PhoneNumberFieldConverter, ProductOptionConverter,
    4444    DefaultObjectConverter)
    4545from waeup.ikoba.utils.helpers import attrs_to_fields
     
    9494    options = schema.List(
    9595        title = u'Options',
    96         value_type = ProductOptionEntryField(),
     96        value_type = ProductOptionField(),
    9797        required = True,
    9898        default = [],
     
    137137        obj2 = ListFieldConverter(None)
    138138        obj3 = PhoneNumberFieldConverter(None)
    139         obj4 = ProductOptionEntryConverter(None)
     139        obj4 = ProductOptionConverter(None)
    140140        verify.verifyObject(IFieldConverter, obj1)
    141141        verify.verifyObject(IFieldConverter, obj2)
     
    145145        verify.verifyClass(IFieldConverter, ListFieldConverter)
    146146        verify.verifyClass(IFieldConverter, PhoneNumberFieldConverter)
    147         verify.verifyClass(IFieldConverter, ProductOptionEntryConverter)
     147        verify.verifyClass(IFieldConverter, ProductOptionConverter)
    148148        return
    149149
Note: See TracChangeset for help on using the changeset viewer.