This was how I modified one of the "offending" Field definitions:

    Field('f_club2', type='reference t_club',
          requires=IS_EMPTY_OR(IS_IN_DB(db,db.t_club.id,"%(f_desc)s")),
          label=T('ClubCode2')),


Basically, I wrapped a IS_EMPTY_OR around what the manual says is the 
default validator.

On Wednesday, December 4, 2013 3:30:56 PM UTC-5, Vch H wrote:
>
> I have  this problem too.
> Where I should specified validators?
>
> On Wednesday, December 4, 2013 6:00:43 PM UTC+2, Scott Hunter wrote:
>>
>> Aha -- I had reference fields, one of which was empty, and they used the 
>> default validator, which does not allow for that.  I specified the 
>> validators for those fields, and that did the trick.  
>>
>> Shouldn't this have been reported as an error in the form ("Field 
>> Required", or somesuch), and not have generated a ticket?
>>
>> And shouldn't the fact that this is a new requirement for reference 
>> fields (or at least a new default setting) be included in the release notes 
>> for this version?
>>
>> Thanks!
>>
>> On Wednesday, December 4, 2013 3:06:05 AM UTC-5, Paolo Valleri wrote:
>>>
>>> Web2py 2.8.2 comes with foreign_keys=ON enabled by default (see 
>>> http://www.sqlite.org/foreignkeys.html)
>>> If you get the issue you mentioned I guess you are violating a foreign 
>>> key constrain.
>>> Please post your model (or the tables definitions involved) so that we 
>>> can figure out what is wrong
>>>
>>> Paolo
>>>
>>> On Wednesday, December 4, 2013 3:26:32 AM UTC+1, Scott Hunter wrote:
>>>>
>>>> I have a site which, after upgrading to 2.8.2 (and clearing out the 
>>>> sessions), when I try update a record via a smartgrid or via admin, I get 
>>>> the error in the title.  I tried the same action on the copy of the site I 
>>>> had made just before upgrading, without any problems.
>>>>
>>>> This is from OSX 10.9.
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to