The scheduler always sees models. It is executed in the same context as a controller. Then you can use import to import anything else you need.
On Monday, 10 August 2015 10:39:37 UTC-5, Peter Gastinger wrote: > > Hi, > > I was wondering whether it is possible to import models when using the > scheduler? I have a couple of scheduler tasks, one of them is created a > textfile which takes a couple of minutes. Scheduling this was pretty easy. > After the file is created, I want to send a mail with it as attachment to a > couple of recipients. I want to use the Mail-object, which is created in > db.py. Unfortunately, this module is not available when the scheduler is > executing my method. > > When running web2py from CLI, there is the parameter -M (which imports the > models), how to you do that using the scheduler or what is the best way to > solve this problem? (preferably without any other scripts, ...) > > Thanks and best regards, > Peter > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.