Django South迁移引发错误' module'对象没有属性' SET_NULL' [英] Django South migration is throwing an error 'module' object has no attribute 'SET_NULL'
问题描述
我刚刚通过 ./manage.py schemamigration --auto
生成了迁移脚本并运行了它.我收到以下错误.我对这可能意味着什么感到困惑.我已经使用SET_NULL一段时间了.因此,这是以前未曾发生过的新事物.知道有什么问题吗?
I just generated the migration scripts through ./manage.py schemamigration --auto
and ran it. I get the following error. I am stumped as to what it could mean. I have been using SET_NULL for a while now. So this is something new that didn't occur earlier. Any idea what could be wrong?
<代码>追溯(最近一次通话):在第16行的文件"./manage.py"中execute_from_command_line(sys.argv)第399行的文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/init.py",在execute_from_command_line中utility.execute()在执行的文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/init.py"中执行self.fetch_command(子命令).run_from_argv(self.argv)在run_from_argv中的第242行,文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/base.py"self.execute(* args,** options. dict )执行中的文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/base.py",第285行输出= self.handle(* args,** options)句柄中的文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/management/commands/schemamigration.py",第111行old_orm = last_migration.orm(),文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/utils/init.py",方法中的第62行值=函数(自身)在orm中的文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/migration/base.py",第432行返回FakeORM(self.migration_class(),self.app_label())在FakeORM中的文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/orm.py",第48行_orm_cache [args] = _FakeORM(* args)
init 中的文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/orm.py",第134行self.retry_failed_fields()在retry_failed_fields中,文件"/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/orm.py",行377fname,modelname,eValueError:无法成功为模型"match"创建字段"winner":"module"对象没有属性"SET_NULL".
Traceback (most recent call last):
File "./manage.py", line 16, in
execute_from_command_line(sys.argv)
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.dict)
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/management/commands/schemamigration.py", line 111, in handle
old_orm = last_migration.orm(),
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/utils/init.py", line 62, in method
value = function(self)
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/migration/base.py", line 432, in orm
return FakeORM(self.migration_class(), self.app_label())
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/orm.py", line 48, in FakeORM
_orm_cache[args] = _FakeORM(*args)
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/orm.py", line 134, in init
self.retry_failed_fields()
File "/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/orm.py", line 377, in retry_failed_fields
fname, modelname, e
ValueError: Cannot successfully create field 'winner' for model 'match': 'module' object has no attribute 'SET_NULL'.
推荐答案
确定这不是有效的问题.我很尴尬地承认我对导致问题的迁移脚本进行了一些小调整.请忽略此问题-似乎我没有办法删除我提出的问题!
OK This is not a valid question. I am embarrassed to admit I made a small tweak on the migration script that caused the problem. Please ignore this question - seems like I dont have a way to delete a question I had asked!
这篇关于Django South迁移引发错误&#39; module&#39;对象没有属性&#39; SET_NULL&#39;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!