为trytond运行任务
trytond-tasks的Python项目详细描述
允许尝试运行任务结束/5,此工作如下:
尝试在模块中的“tasks”目录中查找后缀为“task”的类, 看示例类:
classHelloTask:""" hello print hello word """command='hello'defparser_args(parser):# pleaser review argparserpassdefrun(pool,options):# pool is trytond.pool.Poolprint("hello world")
现在您可以按如下方式调用此任务:trytond tasks-d midatabase hello。
就这样,现在你可以为trytond编写管理任务了。