On Oct 18, 2011, at 12:52 AM, Manuele wrote:

> On 17/10/2011 23:14, Jonathan Lundell wrote:
>> Or import it from a module.
> but modules don't have direct access to the db...

True, but you can pass the db to your functions.

> maybe the two easiest ways are:
> 
> 1. define it in a model file... at least in a mylib.py file separeted to the 
> main db.py or other file you use to define models.
> 
> 2. use the same controller file to define all your controller functions that 
> refer to the function you are talking to

Both of those are fine approaches. 

> 
> I hope I've been useful


Reply via email to