Django South schemamigration error AttributeError: 'Options' object has no attribute 'index_together' -
i working on django web app south db migration. quite new south, , django well. tried using south official tutorials, failed exception: attributeerror: 'options' object has no attribute 'index_together'. run south command this:
python manage.py schemamigration southtut --initial
the southtut models this:
class knight(models.model): name = models.charfield(max_length=100) of_the_round_table = models.booleanfield()
my project models this:
class author(models.model): name = models.charfield(max_length=64) authorid = models.charfield(max_length=32) def __unicode__(self): return self.name class meta: db_table="author" class video(models.model): videoid = models.charfield(max_length=32) videourl = models.urlfield(max_length=200) author = models.foreignkey(author, null=true, related_name="videos", on_delete=models.set_null) class meta: db_table="video" class user(models.model): token = models.charfield(max_length=50, null=true) favs = models.manytomanyfield(video, related_name="fans", db_table="videouserr") class meta: db_table = "user"
the whole error message got below:
traceback (most recent call last): file "manage.py", line 10, in <module> execute_from_command_line(sys.argv) file "/library/python/2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line utility.execute() file "/library/python/2.7/site-packages/django/core/management/__init__.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/library/python/2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(*args, **options.__dict__) file "/library/python/2.7/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(*args, **options) file "/library/python/2.7/site-packages/south-0.7.6-py2.7.egg/south/management/commands/schemamigration.py", line 151, in handle action_name, params in change_source.get_changes(): file "/library/python/2.7/site-packages/south-0.7.6-py2.7.egg/south/creator/changes.py", line 460, in get_changes model_defs = freeze_apps([self.migrations.app_label()]) file "/library/python/2.7/site-packages/south-0.7.6-py2.7.egg/south/creator/freezer.py", line 37, in freeze_apps model_defs[model_key(model)] = prep_for_freeze(model) file "/library/python/2.7/site-packages/south-0.7.6-py2.7.egg/south/creator/freezer.py", line 78, in prep_for_freeze fields['meta'] = remove_useless_meta(modelsinspector.get_model_meta(model)) file "/library/python/2.7/site-packages/south-0.7.6-py2.7.egg/south/modelsinspector.py", line 441, in get_model_meta meta_def[kwd] = get_value(model._meta, defn) file "/library/python/2.7/site-packages/south-0.7.6-py2.7.egg/south/modelsinspector.py", line 258, in get_value value = get_attribute(field, attrname) file "/library/python/2.7/site-packages/south-0.7.6-py2.7.egg/south/utils/__init__.py", line 38, in get_attribute value = getattr(value, part) attributeerror: 'options' object has no attribute 'index_together'
thanks
it's bug in south 0.8. update 0.8.1 or newer , good.
Comments
Post a Comment