[web2py] Re: ListWidget: IS_NULL_OR form.errors

2012-04-03 Thread DenesL
Hi Fran, list:integer field can not contain nulls but you can work around it, here is an example: # model def integer_null(x): if not x: return x w=[] for v in x: if v==: w.append('') else: w.append(v) return w db.define_table(test, Field(text,

[web2py] Re: ListWidget: IS_NULL_OR form.errors

2012-03-30 Thread Anthony
IS_LIST_OF takes a minimum argument, which defaults to 0, so it should still validate if no items are submitted (it also takes a maximum argument). If that's what you're looking for, you shouldn't need IS_EMPTY_OR at all (note, IS_NULL_OR has been deprecated). As for errors, when a validation

[web2py] Re: ListWidget: IS_NULL_OR form.errors

2012-03-30 Thread Fran
On Friday, 30 March 2012 15:43:15 UTC+1, Anthony wrote: IS_LIST_OF takes a minimum argument, which defaults to 0, so it should still validate if no items are submitted (it also takes a maximum argument). If that's what you're looking for, you shouldn't need IS_EMPTY_OR at all Great, that

[web2py] Re: ListWidget: IS_NULL_OR form.errors

2012-03-30 Thread Fran
On Friday, 30 March 2012 16:31:42 UTC+1, Fran wrote: On Friday, 30 March 2012 15:43:15 UTC+1, Anthony wrote: IS_LIST_OF takes a minimum argument, which defaults to 0, so it should still validate if no items are submitted (it also takes a maximum argument). If that's what you're looking

[web2py] Re: ListWidget: IS_NULL_OR form.errors

2012-03-30 Thread Fran
On Friday, 30 March 2012 16:34:43 UTC+1, Fran 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

[web2py] Re: ListWidget: IS_NULL_OR form.errors

2012-03-30 Thread Fran
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

[web2py] Re: ListWidget: IS_NULL_OR form.errors

2012-03-30 Thread Fran
On Friday, 30 March 2012 17:42:45 UTC+1, Fran wrote: 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