Modify ↓
Ticket #97 (closed defect: fixed)
Problem creating migration when removing model which has one-to-one relationship
| Reported by: | bendavis78@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.5 |
| Component: | commands | Version: | 0.6-pre |
| Keywords: | Cc: |
Description
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'
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Oh, the joys of what I found here. Should be fixed in [172], along with other bugs fixing this one made me find.