问题描述
我刚刚通过 ./ 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?
追溯(最近的最后一次呼叫):
文件./manage。 py,第16行,
execute_from_command_line(sys.argv)
文件/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management /init.py,行399,在execute_from_command_line
utility.execute()
文件/home/vivekv/.environments/fantain/local/lib/python2.7 /site-packages/django/core/management/init.py,第392行,执行
self.fetch_command(子命令).run_from_argv(self.argv)
文件/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/base.py,第242行,在run_from_argv
self.execute(* args, **选项。 dict )
文件/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/django/core/management/base.py ,行285,执行
output = self.handle(* args,** options)
文件/ ho我/ 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行,方法
value = function(self)
文件/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/migration/base.py,第432行,orm
return FakeORM(self.migration_class(),self.app_label())
文件/home/vivekv/.environments/fantain/local/lib/python2.7/site-packages/south/orm .py,第48行,在FakeORM
_orm_cache [args] = _FakeORM(* args)
文件/home/vivekv/.environments/fantain/local/lib/python2.7/ site-packages / south / orm.py,第134行, init
self.retry_failed_fields()
文件/home/vivekv/.environments/fantain/local/ lib / python2.7 / site-packages / south / orm.py,第377行,在retry_failed_fields
fname,modelname,e
ValueError:无法成功为模型'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, eValueError: 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迁移正在抛出错误'module'对象没有属性'SET_NULL'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!