I have an sqlform that is not working as expected. I think I have the wrong 
sequence or something and would like some help with it.

*Controller*

# Days Form
if session.days:
    days_form = 
SQLFORM(db.days,record=session.days,submit_button='Save',showid=False,
                               _id='days_form')
else:
    days_form = SQLFORM(db.days, submit_button = 'Save',_id='days_form')
    if session.offer:
        days_form.vars.offer_id = session.offer['id']

if days_form.process().accepted:
    response.flash = 'Days form submitted'
    session.days = days_form.vars.id
    days_form = 
SQLFORM(db.days,record=session.days,submit_button='Save',showid=False,
                               _id='days_form')
elif days_form.errors:
    response.flash = 'Days form has errors'



*Note: On the view, I am just displaying the form and adding a readonly 
attribute on some of the fields. Also, four sqlforms are loaded on this 
page, all coming from and going to the same controller. *

Current form behavior is,
1) When I submit this form the first time it saves all values (Great!)
2) Then it redirects to the same form again (Great again!)
3) But now when I change a value and submit the form, it does not update 
the changes, nor does it display any of the *response.flash* (Not Cool...)
4) It then redirects to the same form again (Great!)
5) Now when I change any value, the form submits and updates the values in 
the database. It also shows the *Days form submitted *response

I need to know why #3 is not working and how to fix it.

-- 
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/d/optout.

Reply via email to