我想運行一個類似這樣的命令,但函數handle (self,*args,**options)
似乎沒有執行嵌套函數。創建django管理命令
如何在handle()
中包含我的功能?
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle(self, *args, **options):
def hello():
print "hello1"
def hello1():
print "hello2"
必須 '叫'爲了執行它們的定義之後的函數:hello(); hello1() – Don 2012-04-20 08:56:38