It is my mistake. That was a wrong example. I am not sure while it failed but I will investigate
Massimo On Nov 7, 5:41 pm, "Wes James" <[EMAIL PROTECTED]> wrote: > OK. I changed: > > (1) > > def index(): > try: > form=t2.update(db.student,db.student.student_id==t2.person_id) > except: > form=t2.create(db.student) > return dict(form=form) > > to this > > (2) > > def index(): > form=t2.update(db.student,db.student.student_id==t2.person_id) > return dict(form=form) > > and it works after i have created a record. Why is the try: except > not working in (1) above? > > If i use 1 above i can start a new form and submit it. But then if i > enter some more data, it says the unique items already exist. If I > use 2 then I can update data but new create a new record. This is > based on having a login requirement for the form. > > thx, > > -wj --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

