Look here for more information about Auth and auth:  
http://web2py.com/books/default/chapter/29/3#Adding-Authentication

Having your models in different folders can reduce the overhead per 
request.  

When your controller uses multiple tables , you can use symbolic links to 
bring in the models you need.  Models execute in alphabetical order, which 
has implications for foreign keys.  Name your soft links accordingly.


On Wednesday, June 27, 2012 8:52:11 AM UTC-4, cyan wrote:
>
>
> Hi,
>
> 1. In the web2py book, there is an example for Auth settings, which 
> presumably resides at top-level inside a model:
>
> auth.settings.register_onaccept.append(lambda form: mail.send(to='
> y...@example.com', subject='new user', message="new user email is %s' % 
> form.vars.email))
>
> and I wonder where exactly do these 'form' and 'form.vars.email' variables 
> come from and how do we know which specific variables are available for 
> which functions in web2py, such information seems to be poorly documented 
> in the manual.
>
> 2. Is it advisable to organize models into different folders named by 
> their related controllers? For example, for all account-related 
> functionalities, I create a model called 'account.py' and put it at 
> 'my_app/models/account/account.py', so that only this model will be 
> executed for all account-related requests. Similarly, a model named 
> 'content.py' is created in 'my_app/models/content/content.py', so that only 
> this model will be executed for all the requests relating to user-generated 
> content. By doing this (as opposed to put all the models in 
> 'my_app/models/'), we can avoid executing models we don't need for certain 
> requests, but we may need to duplicate some code (e.g. create db 
> connections) for different models. Is this a good practice in web2py?
>

-- 



Reply via email to