- Timestamp:
- 15 Mar 2015, 13:02:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py
r12741 r12768 37 37 38 38 39 # Define a validation method for product options 40 class CurrencyMismatch(schema.ValidationError): 41 __doc__ = u"Currency mismatch" 42 43 44 def unique_currency(value): 45 currencies = set([x.currency for x in value]) 46 if len(currencies) > 1: 47 raise CurrencyMismatch(value) 48 return True 49 50 39 51 class ICustomersUtils(Interface): 40 52 """A collection of methods which are subject to customization. … … 324 336 required = True, 325 337 ), 338 constraint=unique_currency, 326 339 required = False, 327 340 readonly = False, … … 379 392 product_options = schema.List( 380 393 value_type = ProductOptionField(), 394 constraint=unique_currency, 381 395 required = False, 382 396 readonly = False,
Note: See TracChangeset for help on using the changeset viewer.