Posting a possible solution in trunk now.
in gluon/sqlhtml.py replace

        if requested_delete:
            ....
            return True

with

        if requested_delete:
            ....
            self.errors.clear()
            return True

let me know if it works for you.

On May 27, 6:07 am, Iceberg <iceb...@21cn.com> wrote:
> > On May 11, 1:08 pm,Iceberg<iceb...@21cn.com> wrote:
>
> > > Hi Massimo,
>
> > > Right now validators are triggered even when a record is successfully
> > > being deleted. This can be annoying in case I am deleting old records
> > > as below:
>
> > > db.define_table('my_table',
> > >     Field('today', 'date',
> > >         requires=IS_DATE_IN_RANGE(minimum=request.now.date()),
> > >         default = request.now.date(),
> > >         )
> > >     )
>
> > > What if we drop all the form.errors content before line 923 in gluon/
> > > sqlhtml.py?
> > >     if requested_delete:
> > >         ......
> > >         self.form.errors = {} # to override unnecessary error message
> > >         return True
>
> > > Or a better way is to dodeletebefore validators are called. Can you
> > > do that?
>
> > > Regards,
> > >Iceberg
>
> On May12, 2:18am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > Good point! Will do.
>
> > Massimo
>
> Any news?

Reply via email to