If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    adesanto-asman-10337  9 years ago

    Hi Bruno, nice shared. But i've a question,

    Why In the module you've defined new DAL connection and not pass

    existing DAL connection in the __init__ of the module 

    or maybe using the gluon.current?

     

    replies (1)
    • andrew-willimott-10653 9 years ago

      Hi, not sure what you mean. Db is defined only once in the __init__. But what if you had referenced two classes in your controller. Does it mean there is a dal connection for each table ? Is that what you meant?

Commented on:

Models are a very special web2py feature, but they like as scripts running on every request. Now with modules we can improve web2py performance with a more Pythonic code base.

Hosting graciously provided by:
Python Anywhere