Changeset 259

Show
Ignore:
Timestamp:
08/30/06 10:40:45 (2 years ago)
Author:
matt
Message:

Correct use of the selection widgets' noneOption to adapt to IKey rather than
ussuming it's a tuple.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/formal/__init__.py

    r257 r259  
    44 
    55 
    6 version_info = (0, 9, 4
     6version_info = (0, 9, 5
    77version = '.'.join([str(i) for i in version_info]) 
    88 
  • trunk/formal/widget.py

    r248 r259  
    200200    noneOption: 
    201201        An object adaptable to IKey and ILabel that is used to identify when 
    202         nothing has been selected. Defaults to ('', '') 
     202        nothing has been selected. 
    203203    """ 
    204204 
     
    216216        value = args.get(key, [''])[0] 
    217217        value = iformal.IStringConvertible(self.original).toType(value) 
    218         if self.noneOption is not None and value == self.noneOption[0]: 
     218        if self.noneOption is not None and \ 
     219                value == iformal.IKey(self.noneOption).key(): 
    219220            value = None 
    220221        return self.original.validate(value) 
     
    367368        value = self._valueFromRequestArgs(key, args) 
    368369        value = iformal.IStringConvertible(self.original).toType(value) 
    369         if self.noneOption is not None and value == self.noneOption[0]
     370        if self.noneOption is not None and value == iformal.IKey(self.noneOption).key()
    370371            value = None 
    371372        return self.original.validate(value) 
  • trunk/setup.py

    r258 r259  
    33setup( 
    44    name='formal', 
    5     version='0.9.4', 
     5    version='0.9.5', 
    66    description='HTML forms framework for Nevow', 
    77    author='Matt Goodall',