1) Generally in db.py file I put just configurations related to setup of database/run app ( Email , Database, Auth ) 2) The table are ( to better maintence ) in separeted files, how are few table , all can stay at same file ( tables.py )
If your system contains many tables you separate them in files respectives to function( domain ) them, you join the have same propose. Em sexta-feira, 28 de outubro de 2016 06:22:29 UTC-3, Arun Kumar escreveu: > > Hi, > I'm new to web2py and trying to develop an application. I have some > queries on how to do certain things on web2py best way, > > 1. I have few tables in my application. Should I write definition in a > single file inside models (models/db.py) or each table definition in a > separate file? > 2. Can we write DB queries in controller itself or it can be separated > from controller? If it can be maintained in separated files what is the > best place to keep and how to access it inside controllers? > > Regards, > Arun > > -- 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.

