On Tuesday, October 31, 2017 at 11:54:59 AM UTC-7, R U wrote: > > I am curious of how to override an existing record in a database via a > form. > > Take for example a simple input of > db = DAL('sqlite://storage.sqlite') > db.define_table('person', > Field('email', requires=IS_EMAIL()), > Field('Your_Zipcode', requires=IS_NOT_EMPTY()), > > If the same email address is entered that was previously in the db I get 2 > records of the same e-mail. > > I don't want to go through the built in auth. I want to keep it simple. > If the person has to change his/her address s/he can simply fill in the > form and it overrides the existing record. > > I get redirected to index when I use the following in the controller. > > http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-and-insert-update- > > > What am i missing? > > Please show your controller function.
In code that I have in front of me, I use update_or_insert() without a form. At home, I think I have an SQLFORM with an example of update_or_insert, and I don't remember any issues, but I can't show it to you from here. /dps -- 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.