id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
97	Problem creating migration when removing model which has one-to-one relationship	bendavis78@…	andrew	"Old models.py (frozen in last migration):
{{{
class FooModel(models.Model):
    somefield = models.IntegerField()

class BarModel(models.Model):
    blahfield = models.IntegerField()
    myfoo = models.OneToOneField(FooModel, blank=True,null=True)

}}}

new models.py
{{{
class BarModel(models.Model):
    blafield = models.IntegerField()
}}}

startmigration output
{{{
$ ./manage.py startmigration testapp test --auto
Traceback (most recent call last):
  File ""./manage.py"", line 11, in <module>
    execute_manager(settings)
  File ""/usr/lib/python2.5/site-packages/django/core/management/__init__.py"", line 350, in execute_manager
    utility.execute()
  File ""/usr/lib/python2.5/site-packages/django/core/management/__init__.py"", line 295, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/usr/lib/python2.5/site-packages/django/core/management/base.py"", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/usr/lib/python2.5/site-packages/django/core/management/base.py"", line 222, in execute
    output = self.handle(*args, **options)
  File ""/home/ben/Projects/southtest/south/management/commands/startmigration.py"", line 245, in handle
    last_orm[mkey]._meta.get_field_by_name(fname)[0],
  File ""/usr/lib/python2.5/site-packages/django/db/models/options.py"", line 285, in get_field_by_name
    % (self.object_name, name))
django.db.models.fields.FieldDoesNotExist: barmodel has no field named 'myfoo'

}}}"	defect	closed	major	0.5	commands	0.6-pre	fixed		
