On Friday, May 18, 2018 at 10:48:35 AM UTC-4, Joe Willrich Lutalo wrote:
>
> Thanks, but in the typical application structure, where would you place
> these function invocations?
>
It is up to you, depending on your desired workflow. auth.bulk_register()
produces a form, so the idea would be to create a controller action to
display that form in the user interface. If you instead want to use
auth.register_bare(), you would have to write your own custom logic to
handle the inserts. You could do this by (a) creating an interface in the
web application itself via a controller and view, or (b) manually running
the commands in a web2py shell. Of course, if you add a controller action
to the web application, you should protect it so only a logged in
administrator can access it.
Example:
def invite_users():
return dict(form=auth.bulk_register())
Then create an associated view with:
{{=form}}
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.