On Sunday, May 21, 2017 at 4:58:24 PM UTC-4, runru...@gmail.com wrote: > > fun = database > zip = table name > inform = Field name > this enters data into the database but I would prefer it run only once > at registration. > fun.zipdip.insert(infom=result) > > An interesting behavior is when I run the above I get 20 dates in the db. > But when I run > --auth.settings.register_onaccept.append(fun.zipdip.insert(infom=result))-- > I end up with quite a few more, about 60, which is preferable. >
auth.settings.register_onaccept must be a list of one or more *functions*, each of which will be called upon registration, with the registration SQLFORM object passed in as the one and only argument. Your current code instead actually does a database insert when setting up auth.settings.register_onaccept. So, every time the model file is executed (presumably on every request), you will get a database insert. Also, because the value added to the register_onaccept list is not actually a callable, you should be getting an error upon registration. 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.