try using a debugger, and step thru to see what your values are, what
you logic is doing...  you should find that helpful.

You can use winpdb; or you can grab an evaluation copy of WindIDE (I
find Wing easier to use) - but either will work.

The first problem is that you allow None for these values in your
tables - comparison against None will raise an exception;
Have some fun going thru this.

- Yarko

On Apr 28, 4:22 am, Johann Spies <[email protected]> wrote:
> Thanks Yarko,
>
> > Hope this makes some sense now:
>
> At least that some darkness about what is happening in the background
> was cleared up - but I still do not understand enough to solve my
> problem.
>
> > After you have digested this some,  have a look at
> >http://web2py.com/book/default/section/7/2?search=form.accepts;
> > If you want, also look at the docstrings for FORM in gluon/html.py
> > (SQLFORM extends FORM).
>
> I did and there I read:
>
>  if form is accepted (and all validators pass) form.vars contains the
>     accepted vars, otherwise form.errors contains the errors.
>     in case of errors the form is modified to present the errors to the user.
>
> So I tried to use the form.vars after the form was accepted.  I get no
> error code (ticket) now but my code is ignored:
>
>     if form.accepts(request.vars, session):
>         if form.vars.begindatum > form.vars.einddatum:
>             message = T("end date before start date")
>             form.errors == True
>         else:
>             form.vars.id = db.navrae.insert(**dict(form.vars))
>             response.flash = 'form accepted'
>
> I suspect I must not set form.errors as it is done by the background process.
>
> I want these tests done when the validators come into play and I
> cannot see how that is done from what I understand of your
> explanation.
>
> Regards
> Johann
>
> --
> "Finally, brethren, whatsoever things are true,  whatsoever things are
> honest, whatsoever things are  just, whatsoever things are pure,
> whatsoever things are lovely, whatsoever things are of good report; if
> there be any virtue, and if there be any praise, think on these
> things."    Philippians 4:8

Reply via email to