Migration Django South throws an object "module" with an error, does not have the attribute "SET_NULL"

I just generated migration scripts via ./manage.py schemamigration --auto and ran it. I get the following error. I'm at a standstill what this can mean. I used SET_NULL for a while. So this is something new that was not there before. Any idea what could be wrong?

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'.

0
source share
2 answers

OK This is an invalid question. I am confused, admitting that I made a small adjustment to the migration script that caused this problem. Please ignore this question - it seems like I have no way to delete the question I asked!

0
source

I wrote here

Short answer: use models.SET_NULL instead of "SET_NULL" . You must replace this in all migrations that have b"SET_NULL"

0
source

Source: https://habr.com/ru/post/1237123/


All Articles