On Friday, 30 March 2012 17:01:43 UTC+1, Anthony wrote:
>
> I see it did default to 0, but the form doesn't get saved...just as I 
>>> originally said...
>>>
>> The error comes from the e in (v, e) = self.other(item)
>> i.e. "value not allowed" from the IS_IN_SET()
>> I tried adding "" to the set, but obviously that's not an integer so it 
>> gets rejected...
>>
> Is the problem that one or more of the input fields generated by the 
> widget is being submitted with no value, and therefore the IS_IN_SET 
> validator is returning an error?
>

Exactly
 

> Do you not want an error in that case?
>

Right
 

> If not, setting IS_IN_SET(..., multiple=True) doesn't work?
>

Nope, as per original post, this gives:

File "C:\Bin\web2py\gluon\sqlhtml.py", line 1290, in accepts
    self.vars.id = self.table.insert(**fields)
  File "C:\Bin\web2py\gluon\dal.py", line 7030, in insert
    ret =  self._db._adapter.insert(self,self._listify(fields))
  File "C:\Bin\web2py\gluon\dal.py", line 968, in insert
    query = self._insert(table,fields)
  File "C:\Bin\web2py\gluon\dal.py", line 964, in _insert
    values = ','.join(self.expand(v,f.type) for f,v in fields)
  File "C:\Bin\web2py\gluon\dal.py", line 964, in <genexpr>
    values = ','.join(self.expand(v,f.type) for f,v in fields)
  File "C:\Bin\web2py\gluon\dal.py", line 1100, in expand
    return str(self.represent(expression,field_type))
  File "C:\Bin\web2py\gluon\dal.py", line 1456, in represent
    obj = [int(item) for item in obj]
TypeError: int() argument must be a string or a number, not 'list'

F

Reply via email to