>
> so far the link and everything works ok, but the first validators are not 
> working so i get an error cos the sh_.field which is autogenerate is not 
> done
>
> if (grid_shifts.create_form and grid_shifts.create_form.errors) or (
> grid_shifts.update_form and grid_shifts.update_form.errors):
>

Are you saying that even when some fields are left empty, the above 
condition is nevertheless false (i.e., no form errors) and the following 
code therefore does not run?

Also, how about something like:

form = grid_shifts.create_form or grid_shifts.update_form
if form and form.errors:


 codeField = grid_shifts.element('input[name=sh_code]')['value']
>

Instead, how about:

    codeField = form.vars.sh_code


  
>  shiftId = db(db.shifts.sh_code == codeField).select(db.shifts.id).as_list
> ()
>  redId =  shiftId[0]["id"]
>

No need for .as_list() or the dictionary syntax -- just do:

    redId = db(db.shifts.sh_code == codeField).select().first().id

 

> session.flash= A(T("Click here if you want to activate shift with that 
> code or if you want to be redirected to the shift."), _href=URL(
> 'turnusi/edit/shifts', args= redId))
>

Why are you using session.flash -- is there a redirect after this?

Anthony 

>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to