Search code examples
pythondjangodjango-modelsdjango-evolution

django-evolution error


I'm trying to use django-evolution to modify some models from an existing project. Now when I go a syncdb it says that I need to do a 'evolve'.

When I try to run:

python manage.py evolve --hint --execute

I am shown this error in the terminal, but I am still new to this so I am having trouble troubleshooting this error.

Error code:

Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/home/steve/lib/python2.6/site-packages/django/core/management/__init__.py", line 361, in execute_manager
utility.execute()
File "/home/steve/lib/python2.6/site-packages/django/core/management/__init__.py", line 306, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/steve/lib/python2.6/site-packages/django/core/management/base.py", line 192, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/steve/lib/python2.6/site-packages/django/core/management/base.py", line 219, in execute
output = self.handle(*args, **options)
File "/var/sites/placeholder/placeholder/placeholder/apps/django_evolution/management/commands/evolve.py", line 87, in handle
hinted_evolution = diff.evolution()
File "/var/sites/placeholder/placeholder/placeholder/apps/django_evolution/diff.py", line 197, in evolution
changed_attrs[prop] = current_field_sig.get(prop, ATTRIBUTE_DEFAULTS[prop])
KeyError: 'field_type'

Thanks, and hopefully someone can help me out.

Steve


Solution

  • I have solved it, and I will post for anyone coming across the same issue.

    I realized that I was at a very stable part of my project. So I made a backup of my db and went ahead and dropped the 2 tables that django_evolution works with.

    Then I ran a syncdb to create the tables again.

    This seemed to have worked and I was able to do my evolutions.